版博士V2.0程序
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Node.js 22 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const EventTarget_1 = __importDefault(require("../../event/EventTarget"));
  7. const MutationRecord_1 = __importDefault(require("../../mutation-observer/MutationRecord"));
  8. const MutationTypeEnum_1 = __importDefault(require("../../mutation-observer/MutationTypeEnum"));
  9. const DOMException_1 = __importDefault(require("../../exception/DOMException"));
  10. const NodeListFactory_1 = __importDefault(require("./NodeListFactory"));
  11. const NodeTypeEnum_1 = __importDefault(require("./NodeTypeEnum"));
  12. const NodeDocumentPositionEnum_1 = __importDefault(require("./NodeDocumentPositionEnum"));
  13. const NodeUtility_1 = __importDefault(require("./NodeUtility"));
  14. /**
  15. * Node.
  16. */
  17. class Node extends EventTarget_1.default {
  18. /**
  19. * Constructor.
  20. */
  21. constructor() {
  22. super();
  23. this.ELEMENT_NODE = NodeTypeEnum_1.default.elementNode;
  24. this.ATTRIBUTE_NODE = NodeTypeEnum_1.default.attributeNode;
  25. this.TEXT_NODE = NodeTypeEnum_1.default.textNode;
  26. this.CDATA_SECTION_NODE = NodeTypeEnum_1.default.cdataSectionNode;
  27. this.COMMENT_NODE = NodeTypeEnum_1.default.commentNode;
  28. this.DOCUMENT_NODE = NodeTypeEnum_1.default.documentNode;
  29. this.DOCUMENT_TYPE_NODE = NodeTypeEnum_1.default.documentTypeNode;
  30. this.DOCUMENT_FRAGMENT_NODE = NodeTypeEnum_1.default.documentFragmentNode;
  31. this.PROCESSING_INSTRUCTION_NODE = NodeTypeEnum_1.default.processingInstructionNode;
  32. this.DOCUMENT_POSITION_CONTAINED_BY = NodeDocumentPositionEnum_1.default.containedBy;
  33. this.DOCUMENT_POSITION_CONTAINS = NodeDocumentPositionEnum_1.default.contains;
  34. this.DOCUMENT_POSITION_DISCONNECTED = NodeDocumentPositionEnum_1.default.disconnect;
  35. this.DOCUMENT_POSITION_FOLLOWING = NodeDocumentPositionEnum_1.default.following;
  36. this.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = NodeDocumentPositionEnum_1.default.implementationSpecific;
  37. this.DOCUMENT_POSITION_PRECEDING = NodeDocumentPositionEnum_1.default.preceding;
  38. this.ownerDocument = null;
  39. this.parentNode = null;
  40. this.childNodes = NodeListFactory_1.default.create();
  41. this.isConnected = false;
  42. // Custom Properties (not part of HTML standard)
  43. this._rootNode = null;
  44. this._observers = [];
  45. this.ownerDocument = this.constructor._ownerDocument;
  46. }
  47. /**
  48. * Returns `Symbol.toStringTag`.
  49. *
  50. * @returns `Symbol.toStringTag`.
  51. */
  52. get [Symbol.toStringTag]() {
  53. return this.constructor.name;
  54. }
  55. /**
  56. * Get text value of children.
  57. *
  58. * @returns Text content.
  59. */
  60. get textContent() {
  61. // Sub-classes should implement this method.
  62. return null;
  63. }
  64. /**
  65. * Sets text content.
  66. *
  67. * @param _textContent Text content.
  68. */
  69. set textContent(_textContent) {
  70. // Do nothing.
  71. // Sub-classes should implement this method.
  72. }
  73. /**
  74. * Node value.
  75. *
  76. * @returns Node value.
  77. */
  78. get nodeValue() {
  79. return null;
  80. }
  81. /**
  82. * Sets node value.
  83. */
  84. set nodeValue(_nodeValue) {
  85. // Do nothing
  86. }
  87. /**
  88. * Node name.
  89. *
  90. * @returns Node name.
  91. */
  92. get nodeName() {
  93. return '';
  94. }
  95. /**
  96. * Previous sibling.
  97. *
  98. * @returns Node.
  99. */
  100. get previousSibling() {
  101. if (this.parentNode) {
  102. const index = this.parentNode.childNodes.indexOf(this);
  103. if (index > 0) {
  104. return this.parentNode.childNodes[index - 1];
  105. }
  106. }
  107. return null;
  108. }
  109. /**
  110. * Next sibling.
  111. *
  112. * @returns Node.
  113. */
  114. get nextSibling() {
  115. if (this.parentNode) {
  116. const index = this.parentNode.childNodes.indexOf(this);
  117. if (index > -1 && index + 1 < this.parentNode.childNodes.length) {
  118. return this.parentNode.childNodes[index + 1];
  119. }
  120. }
  121. return null;
  122. }
  123. /**
  124. * First child.
  125. *
  126. * @returns Node.
  127. */
  128. get firstChild() {
  129. if (this.childNodes.length > 0) {
  130. return this.childNodes[0];
  131. }
  132. return null;
  133. }
  134. /**
  135. * Last child.
  136. *
  137. * @returns Node.
  138. */
  139. get lastChild() {
  140. if (this.childNodes.length > 0) {
  141. return this.childNodes[this.childNodes.length - 1];
  142. }
  143. return null;
  144. }
  145. /**
  146. * Returns parent element.
  147. *
  148. * @returns Element.
  149. */
  150. get parentElement() {
  151. let parent = this.parentNode;
  152. while (parent && parent.nodeType !== Node.ELEMENT_NODE) {
  153. parent = parent.parentNode;
  154. }
  155. return parent;
  156. }
  157. /**
  158. * Returns base URI.
  159. *
  160. * @returns Base URI.
  161. */
  162. get baseURI() {
  163. const base = this.ownerDocument.querySelector('base');
  164. if (base) {
  165. return base.href;
  166. }
  167. return this.ownerDocument.defaultView.location.href;
  168. }
  169. /**
  170. * Returns "true" if the node has child nodes.
  171. *
  172. * @returns "true" if the node has child nodes.
  173. */
  174. hasChildNodes() {
  175. return this.childNodes.length > 0;
  176. }
  177. /**
  178. * Returns "true" if this node contains the other node.
  179. *
  180. * @param otherNode Node to test with.
  181. * @returns "true" if this node contains the other node.
  182. */
  183. contains(otherNode) {
  184. if (this === otherNode) {
  185. return true;
  186. }
  187. for (const childNode of this.childNodes) {
  188. if (childNode === otherNode || childNode.contains(otherNode)) {
  189. return true;
  190. }
  191. }
  192. return false;
  193. }
  194. /**
  195. * Returns closest root node (Document or ShadowRoot).
  196. *
  197. * @param options Options.
  198. * @param options.composed A Boolean that indicates whether the shadow root should be returned (false, the default), or a root node beyond shadow root (true).
  199. * @returns Node.
  200. */
  201. getRootNode(options) {
  202. if (!this.isConnected) {
  203. return this;
  204. }
  205. if (this._rootNode && !options?.composed) {
  206. return this._rootNode;
  207. }
  208. return this.ownerDocument;
  209. }
  210. /**
  211. * Clones a node.
  212. *
  213. * @param [deep=false] "true" to clone deep.
  214. * @returns Cloned node.
  215. */
  216. cloneNode(deep = false) {
  217. const clone = new this.constructor();
  218. // Document has childNodes directly when it is created
  219. if (clone.childNodes.length) {
  220. for (const node of clone.childNodes.slice()) {
  221. node.parentNode.removeChild(node);
  222. }
  223. }
  224. if (deep) {
  225. for (const childNode of this.childNodes) {
  226. const childClone = childNode.cloneNode(true);
  227. childClone.parentNode = clone;
  228. clone.childNodes.push(childClone);
  229. }
  230. }
  231. clone.ownerDocument = this.ownerDocument;
  232. return clone;
  233. }
  234. /**
  235. * Append a child node to childNodes.
  236. *
  237. * @param node Node to append.
  238. * @returns Appended node.
  239. */
  240. appendChild(node) {
  241. if (node === this) {
  242. throw new DOMException_1.default('Not possible to append a node as a child of itself.');
  243. }
  244. // If the type is DocumentFragment, then the child nodes of if it should be moved instead of the actual node.
  245. // See: https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment
  246. if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  247. for (const child of node.childNodes.slice()) {
  248. this.appendChild(child);
  249. }
  250. return node;
  251. }
  252. // Remove the node from its previous parent if it has any.
  253. if (node.parentNode) {
  254. const index = node.parentNode.childNodes.indexOf(node);
  255. if (index !== -1) {
  256. node.parentNode.childNodes.splice(index, 1);
  257. }
  258. }
  259. if (this.isConnected) {
  260. (this.ownerDocument || this)['_cacheID']++;
  261. }
  262. this.childNodes.push(node);
  263. node._connectToNode(this);
  264. // MutationObserver
  265. if (this._observers.length > 0) {
  266. const record = new MutationRecord_1.default();
  267. record.target = this;
  268. record.type = MutationTypeEnum_1.default.childList;
  269. record.addedNodes = [node];
  270. for (const observer of this._observers) {
  271. if (observer.options.subtree) {
  272. node._observe(observer);
  273. }
  274. if (observer.options.childList) {
  275. observer.callback([record]);
  276. }
  277. }
  278. }
  279. return node;
  280. }
  281. /**
  282. * Remove Child element from childNodes array.
  283. *
  284. * @param node Node to remove.
  285. * @returns Removed node.
  286. */
  287. removeChild(node) {
  288. const index = this.childNodes.indexOf(node);
  289. if (index === -1) {
  290. throw new DOMException_1.default('Failed to remove node. Node is not child of parent.');
  291. }
  292. if (this.isConnected) {
  293. (this.ownerDocument || this)['_cacheID']++;
  294. }
  295. this.childNodes.splice(index, 1);
  296. node._connectToNode(null);
  297. // MutationObserver
  298. if (this._observers.length > 0) {
  299. const record = new MutationRecord_1.default();
  300. record.target = this;
  301. record.type = MutationTypeEnum_1.default.childList;
  302. record.removedNodes = [node];
  303. for (const observer of this._observers) {
  304. node._unobserve(observer);
  305. if (observer.options.childList) {
  306. observer.callback([record]);
  307. }
  308. }
  309. }
  310. return node;
  311. }
  312. /**
  313. * Inserts a node before another.
  314. *
  315. * @param newNode Node to insert.
  316. * @param referenceNode Node to insert before.
  317. * @returns Inserted node.
  318. */
  319. insertBefore(newNode, referenceNode) {
  320. // If the type is DocumentFragment, then the child nodes of if it should be moved instead of the actual node.
  321. // See: https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment
  322. if (newNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  323. for (const child of newNode.childNodes.slice()) {
  324. this.insertBefore(child, referenceNode);
  325. }
  326. return newNode;
  327. }
  328. if (referenceNode === null) {
  329. this.appendChild(newNode);
  330. return newNode;
  331. }
  332. if (referenceNode === undefined) {
  333. throw new DOMException_1.default("Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present.", 'TypeError');
  334. }
  335. const index = referenceNode ? this.childNodes.indexOf(referenceNode) : 0;
  336. if (index === -1) {
  337. throw new DOMException_1.default("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.");
  338. }
  339. if (this.isConnected) {
  340. (this.ownerDocument || this)['_cacheID']++;
  341. }
  342. if (newNode.parentNode) {
  343. const index = newNode.parentNode.childNodes.indexOf(newNode);
  344. if (index !== -1) {
  345. newNode.parentNode.childNodes.splice(index, 1);
  346. }
  347. }
  348. this.childNodes.splice(index, 0, newNode);
  349. newNode._connectToNode(this);
  350. // MutationObserver
  351. if (this._observers.length > 0) {
  352. const record = new MutationRecord_1.default();
  353. record.target = this;
  354. record.type = MutationTypeEnum_1.default.childList;
  355. record.addedNodes = [newNode];
  356. for (const observer of this._observers) {
  357. if (observer.options.subtree) {
  358. newNode._observe(observer);
  359. }
  360. if (observer.options.childList) {
  361. observer.callback([record]);
  362. }
  363. }
  364. }
  365. return newNode;
  366. }
  367. /**
  368. * Replaces a node with another.
  369. *
  370. * @param newChild New child.
  371. * @param oldChild Old child.
  372. * @returns Replaced node.
  373. */
  374. replaceChild(newChild, oldChild) {
  375. this.insertBefore(newChild, oldChild);
  376. this.removeChild(oldChild);
  377. return oldChild;
  378. }
  379. /**
  380. * @override
  381. */
  382. dispatchEvent(event) {
  383. const returnValue = super.dispatchEvent(event);
  384. if (event.bubbles && !event._propagationStopped) {
  385. if (this.parentNode) {
  386. return this.parentNode.dispatchEvent(event);
  387. }
  388. // eslint-disable-next-line
  389. if (event.composed && this.nodeType === NodeTypeEnum_1.default.documentFragmentNode && this.host) {
  390. // eslint-disable-next-line
  391. return this.host.dispatchEvent(event);
  392. }
  393. }
  394. return returnValue;
  395. }
  396. /**
  397. * Converts the node to a string.
  398. *
  399. * @param listener Listener.
  400. */
  401. toString() {
  402. return `[object ${this.constructor.name}]`;
  403. }
  404. /**
  405. * Observeres the node.
  406. * Used by MutationObserver, but it is not part of the HTML standard.
  407. *
  408. * @param listener Listener.
  409. */
  410. _observe(listener) {
  411. this._observers.push(listener);
  412. if (listener.options.subtree) {
  413. for (const node of this.childNodes) {
  414. node._observe(listener);
  415. }
  416. }
  417. }
  418. /**
  419. * Stops observing the node.
  420. * Used by MutationObserver, but it is not part of the HTML standard.
  421. *
  422. * @param listener Listener.
  423. */
  424. _unobserve(listener) {
  425. const index = this._observers.indexOf(listener);
  426. if (index !== -1) {
  427. this._observers.splice(index, 1);
  428. }
  429. if (listener.options.subtree) {
  430. for (const node of this.childNodes) {
  431. node._unobserve(listener);
  432. }
  433. }
  434. }
  435. /**
  436. * Connects this element to another element.
  437. *
  438. * @param parentNode Parent node.
  439. */
  440. _connectToNode(parentNode = null) {
  441. const isConnected = !!parentNode && parentNode.isConnected;
  442. if (this.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {
  443. this.parentNode = parentNode;
  444. this._rootNode = isConnected && parentNode ? parentNode._rootNode : null;
  445. }
  446. if (this.isConnected !== isConnected) {
  447. this.isConnected = isConnected;
  448. if (isConnected && this.connectedCallback) {
  449. this.connectedCallback();
  450. }
  451. else if (!isConnected && this.disconnectedCallback) {
  452. if (this.ownerDocument['_activeElement'] === this) {
  453. this.ownerDocument['_activeElement'] = null;
  454. }
  455. this.disconnectedCallback();
  456. }
  457. for (const child of this.childNodes) {
  458. child._connectToNode(this);
  459. }
  460. // eslint-disable-next-line
  461. if (this._shadowRoot) {
  462. // eslint-disable-next-line
  463. this._shadowRoot._connectToNode(this);
  464. }
  465. }
  466. }
  467. /**
  468. * Reports the position of its argument node relative to the node on which it is called.
  469. *
  470. * @see https://dom.spec.whatwg.org/#dom-node-comparedocumentposition
  471. * @param otherNode Other node.
  472. */
  473. compareDocumentPosition(otherNode) {
  474. /**
  475. * 1. If this is other, then return zero.
  476. */
  477. if (this === otherNode) {
  478. return 0;
  479. }
  480. /**
  481. * 2. Let node1 be other and node2 be this.
  482. */
  483. let node1 = otherNode;
  484. let node2 = this;
  485. /**
  486. * 3. Let attr1 and attr2 be null.
  487. */
  488. let attr1 = null;
  489. let attr2 = null;
  490. /**
  491. * 4. If node1 is an attribute, then set attr1 to node1 and node1 to attr1’s element.
  492. */
  493. if (node1.nodeType === Node.ATTRIBUTE_NODE) {
  494. attr1 = node1;
  495. node1 = attr1.ownerElement;
  496. }
  497. /**
  498. * 5. If node2 is an attribute, then:
  499. * 5.1. Set attr2 to node2 and node2 to attr2’s element.
  500. */
  501. if (node2.nodeType === Node.ATTRIBUTE_NODE) {
  502. attr2 = node2;
  503. node2 = attr2.ownerElement;
  504. /**
  505. * 5.2. If attr1 and node1 are non-null, and node2 is node1, then:
  506. */
  507. if (attr1 !== null && node1 !== null && node2 === node1) {
  508. /**
  509. * 5.2.1. For each attr in node2’s attribute list:
  510. */
  511. for (const attr of Object.values(node2.attributes)) {
  512. /**
  513. * 5.2.1.1. If attr equals attr1, then return the result of adding DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC and DOCUMENT_POSITION_PRECEDING.
  514. */
  515. if (NodeUtility_1.default.isEqualNode(attr, attr1)) {
  516. return (Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | Node.DOCUMENT_POSITION_PRECEDING);
  517. }
  518. /**
  519. * 5.2.1.2. If attr equals attr2, then return the result of adding DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC and DOCUMENT_POSITION_FOLLOWING.
  520. */
  521. if (NodeUtility_1.default.isEqualNode(attr, attr2)) {
  522. return (Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | Node.DOCUMENT_POSITION_FOLLOWING);
  523. }
  524. }
  525. }
  526. }
  527. const node2Ancestors = [];
  528. let node2Ancestor = node2;
  529. while (node2Ancestor) {
  530. /**
  531. * 7. If node1 is an ancestor of node2 […] then return the result of adding DOCUMENT_POSITION_CONTAINS to DOCUMENT_POSITION_PRECEDING.
  532. */
  533. if (node2Ancestor === node1) {
  534. return Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING;
  535. }
  536. node2Ancestors.push(node2Ancestor);
  537. node2Ancestor = node2Ancestor.parentNode;
  538. }
  539. const node1Ancestors = [];
  540. let node1Ancestor = node1;
  541. while (node1Ancestor) {
  542. /**
  543. * 8. If node1 is a descendant of node2 […] then return the result of adding DOCUMENT_POSITION_CONTAINED_BY to DOCUMENT_POSITION_FOLLOWING.
  544. */
  545. if (node1Ancestor === node2) {
  546. return Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING;
  547. }
  548. node1Ancestors.push(node1Ancestor);
  549. node1Ancestor = node1Ancestor.parentNode;
  550. }
  551. const reverseArrayIndex = (array, reverseIndex) => {
  552. return array[array.length - 1 - reverseIndex];
  553. };
  554. const root = reverseArrayIndex(node2Ancestors, 0);
  555. /**
  556. * 6. If node1 or node2 is null, or node1’s root is not node2’s root, then return the result of adding
  557. * DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, and either
  558. * DOCUMENT_POSITION_PRECEDING or DOCUMENT_POSITION_FOLLOWING, with the constraint that this is to be consistent, together.
  559. */
  560. if (!root || root !== reverseArrayIndex(node1Ancestors, 0)) {
  561. return (Node.DOCUMENT_POSITION_DISCONNECTED |
  562. Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC |
  563. Node.DOCUMENT_POSITION_FOLLOWING);
  564. }
  565. // Find the lowest common ancestor
  566. let commonAncestorIndex = 0;
  567. const ancestorsMinLength = Math.min(node2Ancestors.length, node1Ancestors.length);
  568. for (let i = 0; i < ancestorsMinLength; ++i) {
  569. const node2Ancestor = reverseArrayIndex(node2Ancestors, i);
  570. const node1Ancestor = reverseArrayIndex(node1Ancestors, i);
  571. if (node2Ancestor !== node1Ancestor) {
  572. break;
  573. }
  574. commonAncestorIndex = i;
  575. }
  576. const commonAncestor = reverseArrayIndex(node2Ancestors, commonAncestorIndex);
  577. // Indexes within the common ancestor
  578. let indexes = 0;
  579. let node2Index = -1;
  580. let node1Index = -1;
  581. const node2Node = reverseArrayIndex(node2Ancestors, commonAncestorIndex + 1);
  582. const node1Node = reverseArrayIndex(node1Ancestors, commonAncestorIndex + 1);
  583. const computeNodeIndexes = (nodes) => {
  584. for (const childNode of nodes) {
  585. computeNodeIndexes(childNode.childNodes);
  586. if (childNode === node2Node) {
  587. node2Index = indexes;
  588. }
  589. else if (childNode === node1Node) {
  590. node1Index = indexes;
  591. }
  592. if (node2Index !== -1 && node1Index !== -1) {
  593. break;
  594. }
  595. indexes++;
  596. }
  597. };
  598. computeNodeIndexes(commonAncestor.childNodes);
  599. /**
  600. * 9. If node1 is preceding node2, then return DOCUMENT_POSITION_PRECEDING.
  601. * 10. Return DOCUMENT_POSITION_FOLLOWING.
  602. */
  603. return node1Index < node2Index
  604. ? Node.DOCUMENT_POSITION_PRECEDING
  605. : Node.DOCUMENT_POSITION_FOLLOWING;
  606. }
  607. }
  608. exports.default = Node;
  609. // Owner document is set when the Node is created by the Document
  610. Node._ownerDocument = null;
  611. // Public properties
  612. Node.ELEMENT_NODE = NodeTypeEnum_1.default.elementNode;
  613. Node.ATTRIBUTE_NODE = NodeTypeEnum_1.default.attributeNode;
  614. Node.TEXT_NODE = NodeTypeEnum_1.default.textNode;
  615. Node.CDATA_SECTION_NODE = NodeTypeEnum_1.default.cdataSectionNode;
  616. Node.COMMENT_NODE = NodeTypeEnum_1.default.commentNode;
  617. Node.DOCUMENT_NODE = NodeTypeEnum_1.default.documentNode;
  618. Node.DOCUMENT_TYPE_NODE = NodeTypeEnum_1.default.documentTypeNode;
  619. Node.DOCUMENT_FRAGMENT_NODE = NodeTypeEnum_1.default.documentFragmentNode;
  620. Node.PROCESSING_INSTRUCTION_NODE = NodeTypeEnum_1.default.processingInstructionNode;
  621. Node.DOCUMENT_POSITION_CONTAINED_BY = NodeDocumentPositionEnum_1.default.containedBy;
  622. Node.DOCUMENT_POSITION_CONTAINS = NodeDocumentPositionEnum_1.default.contains;
  623. Node.DOCUMENT_POSITION_DISCONNECTED = NodeDocumentPositionEnum_1.default.disconnect;
  624. Node.DOCUMENT_POSITION_FOLLOWING = NodeDocumentPositionEnum_1.default.following;
  625. Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = NodeDocumentPositionEnum_1.default.implementationSpecific;
  626. Node.DOCUMENT_POSITION_PRECEDING = NodeDocumentPositionEnum_1.default.preceding;
  627. //# sourceMappingURL=Node.js.map