You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 3 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7. var SimpleRule = function () {
  8. function SimpleRule(key, value, options) {
  9. _classCallCheck(this, SimpleRule);
  10. this.type = 'simple';
  11. this.isProcessed = false;
  12. this.key = key;
  13. this.value = value;
  14. this.options = options;
  15. }
  16. /**
  17. * Generates a CSS string.
  18. */
  19. // eslint-disable-next-line no-unused-vars
  20. _createClass(SimpleRule, [{
  21. key: 'toString',
  22. value: function toString(options) {
  23. if (Array.isArray(this.value)) {
  24. var str = '';
  25. for (var index = 0; index < this.value.length; index++) {
  26. str += this.key + ' ' + this.value[index] + ';';
  27. if (this.value[index + 1]) str += '\n';
  28. }
  29. return str;
  30. }
  31. return this.key + ' ' + this.value + ';';
  32. }
  33. }]);
  34. return SimpleRule;
  35. }();
  36. exports['default'] = SimpleRule;