appearance.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 Declaration = require('../declaration');
  6. var utils = require('../utils');
  7. var Appearance = function (_Declaration) {
  8. _inherits(Appearance, _Declaration);
  9. function Appearance(name, prefixes, all) {
  10. _classCallCheck(this, Appearance);
  11. var _this = _possibleConstructorReturn(this, _Declaration.call(this, name, prefixes, all));
  12. if (_this.prefixes) {
  13. _this.prefixes = utils.uniq(_this.prefixes.map(function (i) {
  14. if (i === '-ms-') {
  15. return '-webkit-';
  16. } else {
  17. return i;
  18. }
  19. }));
  20. }
  21. return _this;
  22. }
  23. return Appearance;
  24. }(Declaration);
  25. Object.defineProperty(Appearance, 'names', {
  26. enumerable: true,
  27. writable: true,
  28. value: ['appearance']
  29. });
  30. module.exports = Appearance;