1 | "use strict";
|
2 | function createElement(tagName) {
|
3 | return document.createElement(tagName);
|
4 | }
|
5 | function createElementNS(namespaceURI, qualifiedName) {
|
6 | return document.createElementNS(namespaceURI, qualifiedName);
|
7 | }
|
8 | function createTextNode(text) {
|
9 | return document.createTextNode(text);
|
10 | }
|
11 | function createComment(text) {
|
12 | return document.createComment(text);
|
13 | }
|
14 | function insertBefore(parentNode, newNode, referenceNode) {
|
15 | parentNode.insertBefore(newNode, referenceNode);
|
16 | }
|
17 | function removeChild(node, child) {
|
18 | node.removeChild(child);
|
19 | }
|
20 | function appendChild(node, child) {
|
21 | node.appendChild(child);
|
22 | }
|
23 | function parentNode(node) {
|
24 | return node.parentNode;
|
25 | }
|
26 | function nextSibling(node) {
|
27 | return node.nextSibling;
|
28 | }
|
29 | function tagName(elm) {
|
30 | return elm.tagName;
|
31 | }
|
32 | function setTextContent(node, text) {
|
33 | node.textContent = text;
|
34 | }
|
35 | function getTextContent(node) {
|
36 | return node.textContent;
|
37 | }
|
38 | function isElement(node) {
|
39 | return node.nodeType === 1;
|
40 | }
|
41 | function isText(node) {
|
42 | return node.nodeType === 3;
|
43 | }
|
44 | function isComment(node) {
|
45 | return node.nodeType === 8;
|
46 | }
|
47 | exports.htmlDomApi = {
|
48 | createElement: createElement,
|
49 | createElementNS: createElementNS,
|
50 | createTextNode: createTextNode,
|
51 | createComment: createComment,
|
52 | insertBefore: insertBefore,
|
53 | removeChild: removeChild,
|
54 | appendChild: appendChild,
|
55 | parentNode: parentNode,
|
56 | nextSibling: nextSibling,
|
57 | tagName: tagName,
|
58 | setTextContent: setTextContent,
|
59 | getTextContent: getTextContent,
|
60 | isElement: isElement,
|
61 | isText: isText,
|
62 | isComment: isComment,
|
63 | };
|
64 | Object.defineProperty(exports, "__esModule", { value: true });
|
65 | exports.default = exports.htmlDomApi;
|
66 |
|
\ | No newline at end of file |