UNPKG

snabbdom

Version:

A virtual DOM library with focus on simplicity, modularity, powerful features and performance.

66 lines 1.72 kB
"use strict"; function createElement(tagName) { return document.createElement(tagName); } function createElementNS(namespaceURI, qualifiedName) { return document.createElementNS(namespaceURI, qualifiedName); } function createTextNode(text) { return document.createTextNode(text); } function createComment(text) { return document.createComment(text); } function insertBefore(parentNode, newNode, referenceNode) { parentNode.insertBefore(newNode, referenceNode); } function removeChild(node, child) { node.removeChild(child); } function appendChild(node, child) { node.appendChild(child); } function parentNode(node) { return node.parentNode; } function nextSibling(node) { return node.nextSibling; } function tagName(elm) { return elm.tagName; } function setTextContent(node, text) { node.textContent = text; } function getTextContent(node) { return node.textContent; } function isElement(node) { return node.nodeType === 1; } function isText(node) { return node.nodeType === 3; } function isComment(node) { return node.nodeType === 8; } exports.htmlDomApi = { createElement: createElement, createElementNS: createElementNS, createTextNode: createTextNode, createComment: createComment, insertBefore: insertBefore, removeChild: removeChild, appendChild: appendChild, parentNode: parentNode, nextSibling: nextSibling, tagName: tagName, setTextContent: setTextContent, getTextContent: getTextContent, isElement: isElement, isText: isText, isComment: isComment, }; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.htmlDomApi; //# sourceMappingURL=htmldomapi.js.map