text-decoration.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. "use strict";
  2. function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
  3. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
  4. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  5. var Declaration = require('../declaration');
  6. var BASIC = ['none', 'underline', 'overline', 'line-through', 'blink', 'inherit', 'initial', 'unset'];
  7. var TextDecoration = /*#__PURE__*/function (_Declaration) {
  8. _inheritsLoose(TextDecoration, _Declaration);
  9. function TextDecoration() {
  10. return _Declaration.apply(this, arguments) || this;
  11. }
  12. var _proto = TextDecoration.prototype;
  13. /**
  14. * Do not add prefixes for basic values.
  15. */
  16. _proto.check = function check(decl) {
  17. return decl.value.split(/\s+/).some(function (i) {
  18. return !BASIC.includes(i);
  19. });
  20. };
  21. return TextDecoration;
  22. }(Declaration);
  23. _defineProperty(TextDecoration, "names", ['text-decoration']);
  24. module.exports = TextDecoration;