UNPKG

html5-utils

Version:
38 lines (36 loc) 850 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.newTextNode = newTextNode; exports.newCommentNode = newCommentNode; exports.newElement = newElement; function newTextNode(value) { return { nodeName: '#text', value: value, parentNode: undefined, attrs: [], __location: undefined }; } function newCommentNode(comment) { return { nodeName: '#comment', data: comment, parentNode: undefined, attrs: [], __location: undefined }; } function newElement(tagName, namespace) { return { nodeName: tagName, tagName: tagName, childNodes: [], namespaceURI: namespace || 'http://www.w3.org/1999/xhtml', attrs: [], parentNode: undefined, __location: undefined }; }