flex-wrap.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5. var flexSpec = require('./flex-spec');
  6. var Declaration = require('../declaration');
  7. var FlexWrap = function (_Declaration) {
  8. _inherits(FlexWrap, _Declaration);
  9. function FlexWrap() {
  10. _classCallCheck(this, FlexWrap);
  11. return _possibleConstructorReturn(this, _Declaration.apply(this, arguments));
  12. }
  13. /**
  14. * Don't add prefix for 2009 spec
  15. */
  16. FlexWrap.prototype.set = function set(decl, prefix) {
  17. var spec = flexSpec(prefix)[0];
  18. if (spec !== 2009) {
  19. return _Declaration.prototype.set.call(this, decl, prefix);
  20. }
  21. return undefined;
  22. };
  23. return FlexWrap;
  24. }(Declaration);
  25. Object.defineProperty(FlexWrap, 'names', {
  26. enumerable: true,
  27. writable: true,
  28. value: ['flex-wrap']
  29. });
  30. module.exports = FlexWrap;