node.js 849 B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. /**
  4. * Node Class as base class for TextNode and HTMLElement.
  5. */
  6. var Node = /** @class */ (function () {
  7. function Node(parentNode) {
  8. if (parentNode === void 0) { parentNode = null; }
  9. this.parentNode = parentNode;
  10. this.childNodes = [];
  11. }
  12. Object.defineProperty(Node.prototype, "innerText", {
  13. get: function () {
  14. return this.rawText;
  15. },
  16. enumerable: false,
  17. configurable: true
  18. });
  19. Object.defineProperty(Node.prototype, "textContent", {
  20. get: function () {
  21. return this.rawText;
  22. },
  23. set: function (val) {
  24. this.rawText = val;
  25. },
  26. enumerable: false,
  27. configurable: true
  28. });
  29. return Node;
  30. }());
  31. exports.default = Node;