image-set.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 Value = require('../value');
  6. var ImageSet = /*#__PURE__*/function (_Value) {
  7. _inheritsLoose(ImageSet, _Value);
  8. function ImageSet() {
  9. return _Value.apply(this, arguments) || this;
  10. }
  11. var _proto = ImageSet.prototype;
  12. /**
  13. * Use non-standard name for WebKit and Firefox
  14. */
  15. _proto.replace = function replace(string, prefix) {
  16. var fixed = _Value.prototype.replace.call(this, string, prefix);
  17. if (prefix === '-webkit-') {
  18. fixed = fixed.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2');
  19. }
  20. return fixed;
  21. };
  22. return ImageSet;
  23. }(Value);
  24. _defineProperty(ImageSet, "names", ['image-set']);
  25. module.exports = ImageSet;