版博士V2.0程序
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

31 righe
881 B

  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const CSSUnits_1 = __importDefault(require("./CSSUnits"));
  7. /**
  8. * CSS unit value.
  9. */
  10. class CSSUnitValue {
  11. /**
  12. * Constructor.
  13. *
  14. * @param value Value.
  15. * @param unit Unit.
  16. */
  17. constructor(value, unit) {
  18. this.unit = null;
  19. this.value = null;
  20. if (typeof value !== 'number') {
  21. throw new TypeError('The provided double value is non-finite');
  22. }
  23. if (!CSSUnits_1.default.includes(unit)) {
  24. throw new TypeError('Invalid unit: ' + unit);
  25. }
  26. this.value = value;
  27. this.unit = unit;
  28. }
  29. }
  30. exports.default = CSSUnitValue;
  31. //# sourceMappingURL=CSSUnitValue.js.map