anonymous.js 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tslib_1 = require("tslib");
  4. var node_1 = tslib_1.__importDefault(require("./node"));
  5. var Anonymous = function (value, index, currentFileInfo, mapLines, rulesetLike, visibilityInfo) {
  6. this.value = value;
  7. this._index = index;
  8. this._fileInfo = currentFileInfo;
  9. this.mapLines = mapLines;
  10. this.rulesetLike = (typeof rulesetLike === 'undefined') ? false : rulesetLike;
  11. this.allowRoot = true;
  12. this.copyVisibilityInfo(visibilityInfo);
  13. };
  14. Anonymous.prototype = Object.assign(new node_1.default(), {
  15. type: 'Anonymous',
  16. eval: function () {
  17. return new Anonymous(this.value, this._index, this._fileInfo, this.mapLines, this.rulesetLike, this.visibilityInfo());
  18. },
  19. compare: function (other) {
  20. return other.toCSS && this.toCSS() === other.toCSS() ? 0 : undefined;
  21. },
  22. isRulesetLike: function () {
  23. return this.rulesetLike;
  24. },
  25. genCSS: function (context, output) {
  26. this.nodeVisible = Boolean(this.value);
  27. if (this.nodeVisible) {
  28. output.add(this.value, this._fileInfo, this._index, this.mapLines);
  29. }
  30. }
  31. });
  32. exports.default = Anonymous;
  33. //# sourceMappingURL=anonymous.js.map