This commit is contained in:
2025-06-16 13:37:14 +02:00
parent ac273655e6
commit a8b82208f7
5100 changed files with 737524 additions and 2 deletions

1
node_modules/node-html-parser/dist/back.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export default function arr_back<T>(arr: T[]): T;

6
node_modules/node-html-parser/dist/back.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function arr_back(arr) {
return arr[arr.length - 1];
}
exports.default = arr_back;

20
node_modules/node-html-parser/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import CommentNode from './nodes/comment';
import HTMLElement, { Options } from './nodes/html';
import Node from './nodes/node';
import TextNode from './nodes/text';
import NodeType from './nodes/type';
import baseParse from './parse';
import valid from './valid';
export { Options } from './nodes/html';
export { parse, HTMLElement, CommentNode, valid, Node, TextNode, NodeType };
declare function parse(data: string, options?: Partial<Options>): HTMLElement;
declare namespace parse {
var parse: typeof baseParse;
var HTMLElement: typeof import("./nodes/html").default;
var CommentNode: typeof import("./nodes/comment").default;
var valid: typeof import("./valid").default;
var Node: typeof import("./nodes/node").default;
var TextNode: typeof import("./nodes/text").default;
var NodeType: typeof import("./nodes/type").default;
}
export default parse;

32
node_modules/node-html-parser/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeType = exports.TextNode = exports.Node = exports.valid = exports.CommentNode = exports.HTMLElement = exports.parse = void 0;
var comment_1 = __importDefault(require("./nodes/comment"));
exports.CommentNode = comment_1.default;
var html_1 = __importDefault(require("./nodes/html"));
exports.HTMLElement = html_1.default;
var node_1 = __importDefault(require("./nodes/node"));
exports.Node = node_1.default;
var text_1 = __importDefault(require("./nodes/text"));
exports.TextNode = text_1.default;
var type_1 = __importDefault(require("./nodes/type"));
exports.NodeType = type_1.default;
var parse_1 = __importDefault(require("./parse"));
var valid_1 = __importDefault(require("./valid"));
exports.valid = valid_1.default;
function parse(data, options) {
if (options === void 0) { options = {}; }
return (0, parse_1.default)(data, options);
}
exports.default = parse;
exports.parse = parse;
parse.parse = parse_1.default;
parse.HTMLElement = html_1.default;
parse.CommentNode = comment_1.default;
parse.valid = valid_1.default;
parse.Node = node_1.default;
parse.TextNode = text_1.default;
parse.NodeType = type_1.default;

1646
node_modules/node-html-parser/dist/main.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

6
node_modules/node-html-parser/dist/matcher.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import { Adapter } from 'css-select/lib/types';
import HTMLElement from './nodes/html';
import Node from './nodes/node';
export declare type Predicate = (node: Node) => node is HTMLElement;
declare const _default: Adapter<Node, HTMLElement>;
export default _default;

106
node_modules/node-html-parser/dist/matcher.js generated vendored Normal file
View File

@@ -0,0 +1,106 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var type_1 = __importDefault(require("./nodes/type"));
function isTag(node) {
return node && node.nodeType === type_1.default.ELEMENT_NODE;
}
function getAttributeValue(elem, name) {
return isTag(elem) ? elem.getAttribute(name) : undefined;
}
function getName(elem) {
return ((elem && elem.rawTagName) || '').toLowerCase();
}
function getChildren(node) {
return node && node.childNodes;
}
function getParent(node) {
return node ? node.parentNode : null;
}
function getText(node) {
return node.text;
}
function removeSubsets(nodes) {
var idx = nodes.length;
var node;
var ancestor;
var replace;
// Check if each node (or one of its ancestors) is already contained in the
// array.
while (--idx > -1) {
node = ancestor = nodes[idx];
// Temporarily remove the node under consideration
nodes[idx] = null;
replace = true;
while (ancestor) {
if (nodes.indexOf(ancestor) > -1) {
replace = false;
nodes.splice(idx, 1);
break;
}
ancestor = getParent(ancestor);
}
// If the node has been found to be unique, re-insert it.
if (replace) {
nodes[idx] = node;
}
}
return nodes;
}
function existsOne(test, elems) {
return elems.some(function (elem) {
return isTag(elem) ? test(elem) || existsOne(test, getChildren(elem)) : false;
});
}
function getSiblings(node) {
var parent = getParent(node);
return parent ? getChildren(parent) : [];
}
function hasAttrib(elem, name) {
return getAttributeValue(elem, name) !== undefined;
}
function findOne(test, elems) {
var elem = null;
for (var i = 0, l = elems === null || elems === void 0 ? void 0 : elems.length; i < l && !elem; i++) {
var el = elems[i];
if (test(el)) {
elem = el;
}
else {
var childs = getChildren(el);
if (childs && childs.length > 0) {
elem = findOne(test, childs);
}
}
}
return elem;
}
function findAll(test, nodes) {
var result = [];
for (var i = 0, j = nodes.length; i < j; i++) {
if (!isTag(nodes[i]))
continue;
if (test(nodes[i]))
result.push(nodes[i]);
var childs = getChildren(nodes[i]);
if (childs)
result = result.concat(findAll(test, childs));
}
return result;
}
exports.default = {
isTag: isTag,
getAttributeValue: getAttributeValue,
getName: getName,
getChildren: getChildren,
getParent: getParent,
getText: getText,
removeSubsets: removeSubsets,
existsOne: existsOne,
getSiblings: getSiblings,
hasAttrib: hasAttrib,
findOne: findOne,
findAll: findAll
};

20
node_modules/node-html-parser/dist/nodes/comment.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import HTMLElement from './html';
import Node from './node';
import NodeType from './type';
export default class CommentNode extends Node {
rawText: string;
rawTagName: string;
clone(): CommentNode;
constructor(rawText: string, parentNode?: HTMLElement, range?: [number, number], rawTagName?: string);
/**
* Node Type declaration.
* @type {Number}
*/
nodeType: NodeType;
/**
* Get unescaped text value of current node and its children.
* @return {string} text content
*/
get text(): string;
toString(): string;
}

57
node_modules/node-html-parser/dist/nodes/comment.js generated vendored Normal file
View File

@@ -0,0 +1,57 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var node_1 = __importDefault(require("./node"));
var type_1 = __importDefault(require("./type"));
var CommentNode = /** @class */ (function (_super) {
__extends(CommentNode, _super);
function CommentNode(rawText, parentNode, range, rawTagName) {
if (parentNode === void 0) { parentNode = null; }
if (rawTagName === void 0) { rawTagName = '!--'; }
var _this = _super.call(this, parentNode, range) || this;
_this.rawText = rawText;
_this.rawTagName = rawTagName;
/**
* Node Type declaration.
* @type {Number}
*/
_this.nodeType = type_1.default.COMMENT_NODE;
return _this;
}
CommentNode.prototype.clone = function () {
return new CommentNode(this.rawText, null, undefined, this.rawTagName);
};
Object.defineProperty(CommentNode.prototype, "text", {
/**
* Get unescaped text value of current node and its children.
* @return {string} text content
*/
get: function () {
return this.rawText;
},
enumerable: false,
configurable: true
});
CommentNode.prototype.toString = function () {
return "<!--".concat(this.rawText, "-->");
};
return CommentNode;
}(node_1.default));
exports.default = CommentNode;

240
node_modules/node-html-parser/dist/nodes/html.d.ts generated vendored Normal file
View File

@@ -0,0 +1,240 @@
import VoidTag from '../void-tag';
import Node from './node';
import NodeType from './type';
export interface KeyAttributes {
id?: string;
class?: string;
}
export interface Attributes {
[key: string]: string;
}
export interface RawAttributes {
[key: string]: string;
}
export declare type InsertPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';
declare class DOMTokenList {
private _set;
private _afterUpdate;
private _validate;
constructor(valuesInit?: string[], afterUpdate?: (t: DOMTokenList) => void);
add(c: string): void;
replace(c1: string, c2: string): void;
remove(c: string): void;
toggle(c: string): void;
contains(c: string): boolean;
get length(): number;
values(): IterableIterator<string>;
get value(): string[];
toString(): string;
}
/**
* HTMLElement, which contains a set of children.
*
* Note: this is a minimalist implementation, no complete tree
* structure provided (no parentNode, nextSibling,
* previousSibling etc).
* @class HTMLElement
* @extends {Node}
*/
export default class HTMLElement extends Node {
rawAttrs: string;
private voidTag;
private _attrs;
private _rawAttrs;
private _parseOptions;
rawTagName: string;
id: string;
classList: DOMTokenList;
/**
* Node Type declaration.
*/
nodeType: NodeType;
/**
* Quote attribute values
* @param attr attribute value
* @returns {string} quoted value
*/
private quoteAttribute;
/**
* Creates an instance of HTMLElement.
* @param keyAttrs id and class attribute
* @param [rawAttrs] attributes in string
*
* @memberof HTMLElement
*/
constructor(tagName: string, keyAttrs: KeyAttributes, rawAttrs?: string, parentNode?: HTMLElement, range?: [number, number], voidTag?: VoidTag, _parseOptions?: Partial<Options>);
/**
* Remove Child element from childNodes array
* @param {HTMLElement} node node to remove
*/
removeChild(node: Node): this;
/**
* Exchanges given child with new child
* @param {HTMLElement} oldNode node to exchange
* @param {HTMLElement} newNode new node
*/
exchangeChild(oldNode: Node, newNode: Node): this;
get tagName(): string;
set tagName(newname: string);
get localName(): string;
get isVoidElement(): boolean;
/**
* Get escpaed (as-it) text value of current node and its children.
* @return {string} text content
*/
get rawText(): string;
get textContent(): string;
set textContent(val: string);
/**
* Get unescaped text value of current node and its children.
* @return {string} text content
*/
get text(): string;
/**
* Get structured Text (with '\n' etc.)
* @return {string} structured text
*/
get structuredText(): string;
toString(): string;
get innerHTML(): string;
set innerHTML(content: string);
set_content(content: string | Node | Node[], options?: Partial<Options>): this;
replaceWith(...nodes: (string | Node)[]): this;
get outerHTML(): string;
/**
* Trim element from right (in block) after seeing pattern in a TextNode.
* @param {RegExp} pattern pattern to find
* @return {HTMLElement} reference to current node
*/
trimRight(pattern: RegExp): this;
/**
* Get DOM structure
* @return {string} structure
*/
get structure(): string;
/**
* Remove whitespaces in this sub tree.
* @return {HTMLElement} pointer to this
*/
removeWhitespace(): this;
/**
* Query CSS selector to find matching nodes.
* @param {string} selector Simplified CSS selector
* @return {HTMLElement[]} matching elements
*/
querySelectorAll(selector: string): HTMLElement[];
/**
* Query CSS Selector to find matching node.
* @param {string} selector Simplified CSS selector
* @return {(HTMLElement|null)} matching node
*/
querySelector(selector: string): HTMLElement | null;
/**
* find elements by their tagName
* @param {string} tagName the tagName of the elements to select
*/
getElementsByTagName(tagName: string): Array<HTMLElement>;
/**
* find element by it's id
* @param {string} id the id of the element to select
* @returns {HTMLElement | null} the element with the given id or null if not found
*/
getElementById(id: string): HTMLElement | null;
/**
* traverses the Element and its parents (heading toward the document root) until it finds a node that matches the provided selector string. Will return itself or the matching ancestor. If no such element exists, it returns null.
* @param selector a DOMString containing a selector list
* @returns {HTMLElement | null} the element with the given id or null if not found
*/
closest(selector: string): HTMLElement | null;
/**
* Append a child node to childNodes
* @param {Node} node node to append
* @return {Node} node appended
*/
appendChild<T extends Node = Node>(node: T): T;
/**
* Get first child node
* @return {Node | undefined} first child node; or undefined if none
*/
get firstChild(): Node | undefined;
/**
* Get last child node
* @return {Node | undefined} last child node; or undefined if none
*/
get lastChild(): Node | undefined;
/**
* Get attributes
* @access private
* @return {Object} parsed and unescaped attributes
*/
get attrs(): Attributes;
get attributes(): Record<string, string>;
/**
* Get escaped (as-is) attributes
* @return {Object} parsed attributes
*/
get rawAttributes(): RawAttributes;
removeAttribute(key: string): this;
hasAttribute(key: string): boolean;
/**
* Get an attribute
* @return {string | undefined} value of the attribute; or undefined if not exist
*/
getAttribute(key: string): string | undefined;
/**
* Set an attribute value to the HTMLElement
* @param {string} key The attribute name
* @param {string} value The value to set, or null / undefined to remove an attribute
*/
setAttribute(key: string, value: string): this;
/**
* Replace all the attributes of the HTMLElement by the provided attributes
* @param {Attributes} attributes the new attribute set
*/
setAttributes(attributes: Attributes): this;
insertAdjacentHTML(where: InsertPosition, html: string): this;
get nextSibling(): Node | null;
get nextElementSibling(): HTMLElement | null;
get previousSibling(): Node | null;
get previousElementSibling(): HTMLElement | null;
get classNames(): string;
/**
* Clone this Node
*/
clone(): Node;
}
export interface Options {
lowerCaseTagName?: boolean;
comment?: boolean;
/**
* @see PR #215 for explanation
*/
fixNestedATags?: boolean;
parseNoneClosedTags?: boolean;
blockTextElements: {
[tag: string]: boolean;
};
voidTag?: {
/**
* options, default value is ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr']
*/
tags?: string[];
/**
* void tag serialisation, add a final slash <br/>
*/
closingSlash?: boolean;
};
}
/**
* Parses HTML and returns a root element
* Parse a chuck of HTML source.
* @param {string} data html
* @return {HTMLElement} root element
*/
export declare function base_parse(data: string, options?: Partial<Options>): HTMLElement[];
/**
* Parses HTML and returns a root element
* Parse a chuck of HTML source.
*/
export declare function parse(data: string, options?: Partial<Options>): HTMLElement;
export {};

1218
node_modules/node-html-parser/dist/nodes/html.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

24
node_modules/node-html-parser/dist/nodes/node.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import NodeType from './type';
import HTMLElement from './html';
/**
* Node Class as base class for TextNode and HTMLElement.
*/
export default abstract class Node {
parentNode: HTMLElement;
abstract rawTagName: string;
abstract nodeType: NodeType;
childNodes: Node[];
range: readonly [number, number];
abstract text: string;
abstract rawText: string;
abstract toString(): string;
abstract clone(): Node;
constructor(parentNode?: HTMLElement, range?: [number, number]);
/**
* Remove current node
*/
remove(): this;
get innerText(): string;
get textContent(): string;
set textContent(val: string);
}

52
node_modules/node-html-parser/dist/nodes/node.js generated vendored Normal file
View File

@@ -0,0 +1,52 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var he_1 = require("he");
/**
* Node Class as base class for TextNode and HTMLElement.
*/
var Node = /** @class */ (function () {
function Node(parentNode, range) {
if (parentNode === void 0) { parentNode = null; }
this.parentNode = parentNode;
this.childNodes = [];
Object.defineProperty(this, 'range', {
enumerable: false,
writable: true,
configurable: true,
value: range !== null && range !== void 0 ? range : [-1, -1]
});
}
/**
* Remove current node
*/
Node.prototype.remove = function () {
var _this = this;
if (this.parentNode) {
var children = this.parentNode.childNodes;
this.parentNode.childNodes = children.filter(function (child) {
return _this !== child;
});
this.parentNode = null;
}
return this;
};
Object.defineProperty(Node.prototype, "innerText", {
get: function () {
return this.rawText;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Node.prototype, "textContent", {
get: function () {
return (0, he_1.decode)(this.rawText);
},
set: function (val) {
this.rawText = (0, he_1.encode)(val);
},
enumerable: false,
configurable: true
});
return Node;
}());
exports.default = Node;

44
node_modules/node-html-parser/dist/nodes/text.d.ts generated vendored Normal file
View File

@@ -0,0 +1,44 @@
import HTMLElement from './html';
import Node from './node';
import NodeType from './type';
/**
* TextNode to contain a text element in DOM tree.
* @param {string} value [description]
*/
export default class TextNode extends Node {
clone(): TextNode;
constructor(rawText: string, parentNode?: HTMLElement, range?: [number, number]);
/**
* Node Type declaration.
* @type {Number}
*/
nodeType: NodeType;
rawTagName: string;
private _rawText;
private _trimmedRawText?;
private _trimmedText?;
get rawText(): string;
/**
* Set rawText and invalidate trimmed caches
*/
set rawText(text: string);
/**
* Returns raw text with all whitespace trimmed except single leading/trailing non-breaking space
*/
get trimmedRawText(): string;
/**
* Returns text with all whitespace trimmed except single leading/trailing non-breaking space
*/
get trimmedText(): string;
/**
* Get unescaped text value of current node and its children.
* @return {string} text content
*/
get text(): string;
/**
* Detect if the node contains only white space.
* @return {boolean}
*/
get isWhitespace(): boolean;
toString(): string;
}

144
node_modules/node-html-parser/dist/nodes/text.js generated vendored Normal file
View File

@@ -0,0 +1,144 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var he_1 = require("he");
var node_1 = __importDefault(require("./node"));
var type_1 = __importDefault(require("./type"));
/**
* TextNode to contain a text element in DOM tree.
* @param {string} value [description]
*/
var TextNode = /** @class */ (function (_super) {
__extends(TextNode, _super);
function TextNode(rawText, parentNode, range) {
if (parentNode === void 0) { parentNode = null; }
var _this = _super.call(this, parentNode, range) || this;
/**
* Node Type declaration.
* @type {Number}
*/
_this.nodeType = type_1.default.TEXT_NODE;
_this.rawTagName = '';
_this._rawText = rawText;
return _this;
}
TextNode.prototype.clone = function () {
return new TextNode(this._rawText, null);
};
Object.defineProperty(TextNode.prototype, "rawText", {
get: function () {
return this._rawText;
},
/**
* Set rawText and invalidate trimmed caches
*/
set: function (text) {
this._rawText = text;
this._trimmedRawText = void 0;
this._trimmedText = void 0;
},
enumerable: false,
configurable: true
});
Object.defineProperty(TextNode.prototype, "trimmedRawText", {
/**
* Returns raw text with all whitespace trimmed except single leading/trailing non-breaking space
*/
get: function () {
if (this._trimmedRawText !== undefined)
return this._trimmedRawText;
this._trimmedRawText = trimText(this.rawText);
return this._trimmedRawText;
},
enumerable: false,
configurable: true
});
Object.defineProperty(TextNode.prototype, "trimmedText", {
/**
* Returns text with all whitespace trimmed except single leading/trailing non-breaking space
*/
get: function () {
if (this._trimmedText !== undefined)
return this._trimmedText;
this._trimmedText = trimText(this.text);
return this._trimmedText;
},
enumerable: false,
configurable: true
});
Object.defineProperty(TextNode.prototype, "text", {
/**
* Get unescaped text value of current node and its children.
* @return {string} text content
*/
get: function () {
return (0, he_1.decode)(this.rawText);
},
enumerable: false,
configurable: true
});
Object.defineProperty(TextNode.prototype, "isWhitespace", {
/**
* Detect if the node contains only white space.
* @return {boolean}
*/
get: function () {
return /^(\s|&nbsp;)*$/.test(this.rawText);
},
enumerable: false,
configurable: true
});
TextNode.prototype.toString = function () {
return this.rawText;
};
return TextNode;
}(node_1.default));
exports.default = TextNode;
/**
* Trim whitespace except single leading/trailing non-breaking space
*/
function trimText(text) {
var i = 0;
var startPos;
var endPos;
while (i >= 0 && i < text.length) {
if (/\S/.test(text[i])) {
if (startPos === undefined) {
startPos = i;
i = text.length;
}
else {
endPos = i;
i = void 0;
}
}
if (startPos === undefined)
i++;
else
i--;
}
if (startPos === undefined)
startPos = 0;
if (endPos === undefined)
endPos = text.length - 1;
var hasLeadingSpace = startPos > 0 && /[^\S\r\n]/.test(text[startPos - 1]);
var hasTrailingSpace = endPos < (text.length - 1) && /[^\S\r\n]/.test(text[endPos + 1]);
return (hasLeadingSpace ? ' ' : '') + text.slice(startPos, endPos + 1) + (hasTrailingSpace ? ' ' : '');
}

6
node_modules/node-html-parser/dist/nodes/type.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
declare enum NodeType {
ELEMENT_NODE = 1,
TEXT_NODE = 3,
COMMENT_NODE = 8
}
export default NodeType;

9
node_modules/node-html-parser/dist/nodes/type.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var NodeType;
(function (NodeType) {
NodeType[NodeType["ELEMENT_NODE"] = 1] = "ELEMENT_NODE";
NodeType[NodeType["TEXT_NODE"] = 3] = "TEXT_NODE";
NodeType[NodeType["COMMENT_NODE"] = 8] = "COMMENT_NODE";
})(NodeType || (NodeType = {}));
exports.default = NodeType;

1
node_modules/node-html-parser/dist/parse.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { parse as default } from './nodes/html';

5
node_modules/node-html-parser/dist/parse.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = void 0;
var html_1 = require("./nodes/html");
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return html_1.parse; } });

6
node_modules/node-html-parser/dist/valid.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import { Options } from './nodes/html';
/**
* Parses HTML and returns a root element
* Parse a chuck of HTML source.
*/
export default function valid(data: string, options?: Partial<Options>): boolean;

13
node_modules/node-html-parser/dist/valid.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var html_1 = require("./nodes/html");
/**
* Parses HTML and returns a root element
* Parse a chuck of HTML source.
*/
function valid(data, options) {
if (options === void 0) { options = {}; }
var stack = (0, html_1.base_parse)(data, options);
return Boolean(stack.length === 1);
}
exports.default = valid;

7
node_modules/node-html-parser/dist/void-tag.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
export default class VoidTag {
addClosingSlash: boolean;
private voidTags;
constructor(addClosingSlash?: boolean, tags?: string[]);
formatNode(tag: string, attrs: string, innerHTML: string): string;
isVoidElement(tag: string): boolean;
}

29
node_modules/node-html-parser/dist/void-tag.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var VoidTag = /** @class */ (function () {
function VoidTag(addClosingSlash, tags) {
if (addClosingSlash === void 0) { addClosingSlash = false; }
this.addClosingSlash = addClosingSlash;
if (Array.isArray(tags)) {
this.voidTags = tags.reduce(function (set, tag) {
return set.add(tag.toLowerCase()).add(tag.toUpperCase()).add(tag);
}, new Set());
}
else {
this.voidTags = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'].reduce(function (set, tag) {
return set.add(tag.toLowerCase()).add(tag.toUpperCase()).add(tag);
}, new Set());
}
}
VoidTag.prototype.formatNode = function (tag, attrs, innerHTML) {
var addClosingSlash = this.addClosingSlash;
var closingSpace = (addClosingSlash && attrs && !attrs.endsWith(' ')) ? ' ' : '';
var closingSlash = addClosingSlash ? "".concat(closingSpace, "/") : '';
return this.isVoidElement(tag.toLowerCase()) ? "<".concat(tag).concat(attrs).concat(closingSlash, ">") : "<".concat(tag).concat(attrs, ">").concat(innerHTML, "</").concat(tag, ">");
};
VoidTag.prototype.isVoidElement = function (tag) {
return this.voidTags.has(tag);
};
return VoidTag;
}());
exports.default = VoidTag;