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.

49 lines
1.8 KiB

  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. extendStatics(d, b);
  11. function __() { this.constructor = d; }
  12. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13. };
  14. })();
  15. var __importDefault = (this && this.__importDefault) || function (mod) {
  16. return (mod && mod.__esModule) ? mod : { "default": mod };
  17. };
  18. Object.defineProperty(exports, "__esModule", { value: true });
  19. var node_1 = __importDefault(require("./node"));
  20. var type_1 = __importDefault(require("./type"));
  21. var CommentNode = /** @class */ (function (_super) {
  22. __extends(CommentNode, _super);
  23. function CommentNode(rawText) {
  24. var _this = _super.call(this) || this;
  25. _this.rawText = rawText;
  26. /**
  27. * Node Type declaration.
  28. * @type {Number}
  29. */
  30. _this.nodeType = type_1.default.COMMENT_NODE;
  31. return _this;
  32. }
  33. Object.defineProperty(CommentNode.prototype, "text", {
  34. /**
  35. * Get unescaped text value of current node and its children.
  36. * @return {string} text content
  37. */
  38. get: function () {
  39. return this.rawText;
  40. },
  41. enumerable: false,
  42. configurable: true
  43. });
  44. CommentNode.prototype.toString = function () {
  45. return "<!--" + this.rawText + "-->";
  46. };
  47. return CommentNode;
  48. }(node_1.default));
  49. exports.default = CommentNode;