Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
11
Frontend-Learner/node_modules/dom-serializer/LICENSE
generated
vendored
Normal file
11
Frontend-Learner/node_modules/dom-serializer/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 The cheeriojs contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
109
Frontend-Learner/node_modules/dom-serializer/README.md
generated
vendored
Normal file
109
Frontend-Learner/node_modules/dom-serializer/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
# dom-serializer [](https://travis-ci.com/cheeriojs/dom-serializer)
|
||||
|
||||
Renders a [domhandler](https://github.com/fb55/domhandler) DOM node or an array of domhandler DOM nodes to a string.
|
||||
|
||||
```js
|
||||
import render from "dom-serializer";
|
||||
|
||||
// OR
|
||||
|
||||
const render = require("dom-serializer").default;
|
||||
```
|
||||
|
||||
# API
|
||||
|
||||
## `render`
|
||||
|
||||
▸ **render**(`node`: Node \| Node[], `options?`: [_Options_](#Options)): _string_
|
||||
|
||||
Renders a DOM node or an array of DOM nodes to a string.
|
||||
|
||||
Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
|
||||
#### Parameters:
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| :-------- | :--------------------------------- | :------------ | :----------------------------- |
|
||||
| `node` | Node \| Node[] | - | Node to be rendered. |
|
||||
| `options` | [_DomSerializerOptions_](#Options) | {} | Changes serialization behavior |
|
||||
|
||||
**Returns:** _string_
|
||||
|
||||
## Options
|
||||
|
||||
### `encodeEntities`
|
||||
|
||||
• `Optional` **decodeEntities**: _boolean | "utf8"_
|
||||
|
||||
Encode characters that are either reserved in HTML or XML.
|
||||
|
||||
If `xmlMode` is `true` or the value not `'utf8'`, characters outside of the utf8 range will be encoded as well.
|
||||
|
||||
**`default`** `decodeEntities`
|
||||
|
||||
---
|
||||
|
||||
### `decodeEntities`
|
||||
|
||||
• `Optional` **decodeEntities**: _boolean_
|
||||
|
||||
Option inherited from parsing; will be used as the default value for `encodeEntities`.
|
||||
|
||||
**`default`** true
|
||||
|
||||
---
|
||||
|
||||
### `emptyAttrs`
|
||||
|
||||
• `Optional` **emptyAttrs**: _boolean_
|
||||
|
||||
Print an empty attribute's value.
|
||||
|
||||
**`default`** xmlMode
|
||||
|
||||
**`example`** With <code>emptyAttrs: false</code>: <code><input checked></code>
|
||||
|
||||
**`example`** With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
||||
|
||||
---
|
||||
|
||||
### `selfClosingTags`
|
||||
|
||||
• `Optional` **selfClosingTags**: _boolean_
|
||||
|
||||
Print self-closing tags for tags without contents.
|
||||
|
||||
**`default`** xmlMode
|
||||
|
||||
**`example`** With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
||||
|
||||
**`example`** With <code>selfClosingTags: true</code>: <code><foo /></code>
|
||||
|
||||
---
|
||||
|
||||
### `xmlMode`
|
||||
|
||||
• `Optional` **xmlMode**: _boolean_ \| _"foreign"_
|
||||
|
||||
Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
||||
|
||||
If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
||||
|
||||
**`default`** false
|
||||
|
||||
---
|
||||
|
||||
## Ecosystem
|
||||
|
||||
| Name | Description |
|
||||
| ------------------------------------------------------------- | ------------------------------------------------------- |
|
||||
| [htmlparser2](https://github.com/fb55/htmlparser2) | Fast & forgiving HTML/XML parser |
|
||||
| [domhandler](https://github.com/fb55/domhandler) | Handler for htmlparser2 that turns documents into a DOM |
|
||||
| [domutils](https://github.com/fb55/domutils) | Utilities for working with domhandler's DOM |
|
||||
| [css-select](https://github.com/fb55/css-select) | CSS selector engine, compatible with domhandler's DOM |
|
||||
| [cheerio](https://github.com/cheeriojs/cheerio) | The jQuery API for domhandler's DOM |
|
||||
| [dom-serializer](https://github.com/cheeriojs/dom-serializer) | Serializer for domhandler's DOM |
|
||||
|
||||
---
|
||||
|
||||
LICENSE: MIT
|
||||
3
Frontend-Learner/node_modules/dom-serializer/lib/esm/foreignNames.d.ts
generated
vendored
Normal file
3
Frontend-Learner/node_modules/dom-serializer/lib/esm/foreignNames.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export declare const elementNames: Map<string, string>;
|
||||
export declare const attributeNames: Map<string, string>;
|
||||
//# sourceMappingURL=foreignNames.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"foreignNames.d.ts","sourceRoot":"","sources":["../../src/foreignNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAwCxB,CAAC;AACF,eAAO,MAAM,cAAc,qBA8D1B,CAAC"}
|
||||
100
Frontend-Learner/node_modules/dom-serializer/lib/esm/foreignNames.js
generated
vendored
Normal file
100
Frontend-Learner/node_modules/dom-serializer/lib/esm/foreignNames.js
generated
vendored
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
export const elementNames = new Map([
|
||||
"altGlyph",
|
||||
"altGlyphDef",
|
||||
"altGlyphItem",
|
||||
"animateColor",
|
||||
"animateMotion",
|
||||
"animateTransform",
|
||||
"clipPath",
|
||||
"feBlend",
|
||||
"feColorMatrix",
|
||||
"feComponentTransfer",
|
||||
"feComposite",
|
||||
"feConvolveMatrix",
|
||||
"feDiffuseLighting",
|
||||
"feDisplacementMap",
|
||||
"feDistantLight",
|
||||
"feDropShadow",
|
||||
"feFlood",
|
||||
"feFuncA",
|
||||
"feFuncB",
|
||||
"feFuncG",
|
||||
"feFuncR",
|
||||
"feGaussianBlur",
|
||||
"feImage",
|
||||
"feMerge",
|
||||
"feMergeNode",
|
||||
"feMorphology",
|
||||
"feOffset",
|
||||
"fePointLight",
|
||||
"feSpecularLighting",
|
||||
"feSpotLight",
|
||||
"feTile",
|
||||
"feTurbulence",
|
||||
"foreignObject",
|
||||
"glyphRef",
|
||||
"linearGradient",
|
||||
"radialGradient",
|
||||
"textPath",
|
||||
].map((val) => [val.toLowerCase(), val]));
|
||||
export const attributeNames = new Map([
|
||||
"definitionURL",
|
||||
"attributeName",
|
||||
"attributeType",
|
||||
"baseFrequency",
|
||||
"baseProfile",
|
||||
"calcMode",
|
||||
"clipPathUnits",
|
||||
"diffuseConstant",
|
||||
"edgeMode",
|
||||
"filterUnits",
|
||||
"glyphRef",
|
||||
"gradientTransform",
|
||||
"gradientUnits",
|
||||
"kernelMatrix",
|
||||
"kernelUnitLength",
|
||||
"keyPoints",
|
||||
"keySplines",
|
||||
"keyTimes",
|
||||
"lengthAdjust",
|
||||
"limitingConeAngle",
|
||||
"markerHeight",
|
||||
"markerUnits",
|
||||
"markerWidth",
|
||||
"maskContentUnits",
|
||||
"maskUnits",
|
||||
"numOctaves",
|
||||
"pathLength",
|
||||
"patternContentUnits",
|
||||
"patternTransform",
|
||||
"patternUnits",
|
||||
"pointsAtX",
|
||||
"pointsAtY",
|
||||
"pointsAtZ",
|
||||
"preserveAlpha",
|
||||
"preserveAspectRatio",
|
||||
"primitiveUnits",
|
||||
"refX",
|
||||
"refY",
|
||||
"repeatCount",
|
||||
"repeatDur",
|
||||
"requiredExtensions",
|
||||
"requiredFeatures",
|
||||
"specularConstant",
|
||||
"specularExponent",
|
||||
"spreadMethod",
|
||||
"startOffset",
|
||||
"stdDeviation",
|
||||
"stitchTiles",
|
||||
"surfaceScale",
|
||||
"systemLanguage",
|
||||
"tableValues",
|
||||
"targetX",
|
||||
"targetY",
|
||||
"textLength",
|
||||
"viewBox",
|
||||
"viewTarget",
|
||||
"xChannelSelector",
|
||||
"yChannelSelector",
|
||||
"zoomAndPan",
|
||||
].map((val) => [val.toLowerCase(), val]));
|
||||
52
Frontend-Learner/node_modules/dom-serializer/lib/esm/index.d.ts
generated
vendored
Normal file
52
Frontend-Learner/node_modules/dom-serializer/lib/esm/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import type { AnyNode } from "domhandler";
|
||||
export interface DomSerializerOptions {
|
||||
/**
|
||||
* Print an empty attribute's value.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
|
||||
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
||||
*/
|
||||
emptyAttrs?: boolean;
|
||||
/**
|
||||
* Print self-closing tags for tags without contents.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
||||
* @example With <code>selfClosingTags: true</code>: <code><foo /></code>
|
||||
*/
|
||||
selfClosingTags?: boolean;
|
||||
/**
|
||||
* Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
||||
*
|
||||
* If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean | "foreign";
|
||||
/**
|
||||
* Encode characters that are either reserved in HTML or XML.
|
||||
*
|
||||
* If `xmlMode` is `true` or the value not `'utf8'`, characters outside of the utf8 range will be encoded as well.
|
||||
*
|
||||
* @default `decodeEntities`
|
||||
*/
|
||||
encodeEntities?: boolean | "utf8";
|
||||
/**
|
||||
* Option inherited from parsing; will be used as the default value for `encodeEntities`.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
decodeEntities?: boolean;
|
||||
}
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
export declare function render(node: AnyNode | ArrayLike<AnyNode>, options?: DomSerializerOptions): string;
|
||||
export default render;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/lib/esm/index.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/lib/esm/index.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EAMR,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA4ED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,EAClC,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAUR;AAED,eAAe,MAAM,CAAC"}
|
||||
190
Frontend-Learner/node_modules/dom-serializer/lib/esm/index.js
generated
vendored
Normal file
190
Frontend-Learner/node_modules/dom-serializer/lib/esm/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
/*
|
||||
* Module dependencies
|
||||
*/
|
||||
import * as ElementType from "domelementtype";
|
||||
import { encodeXML, escapeAttribute, escapeText } from "entities";
|
||||
/**
|
||||
* Mixed-case SVG and MathML tags & attributes
|
||||
* recognized by the HTML parser.
|
||||
*
|
||||
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
||||
*/
|
||||
import { elementNames, attributeNames } from "./foreignNames.js";
|
||||
const unencodedElements = new Set([
|
||||
"style",
|
||||
"script",
|
||||
"xmp",
|
||||
"iframe",
|
||||
"noembed",
|
||||
"noframes",
|
||||
"plaintext",
|
||||
"noscript",
|
||||
]);
|
||||
function replaceQuotes(value) {
|
||||
return value.replace(/"/g, """);
|
||||
}
|
||||
/**
|
||||
* Format attributes
|
||||
*/
|
||||
function formatAttributes(attributes, opts) {
|
||||
var _a;
|
||||
if (!attributes)
|
||||
return;
|
||||
const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false
|
||||
? replaceQuotes
|
||||
: opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? encodeXML
|
||||
: escapeAttribute;
|
||||
return Object.keys(attributes)
|
||||
.map((key) => {
|
||||
var _a, _b;
|
||||
const value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case attribute names */
|
||||
key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
|
||||
}
|
||||
if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
|
||||
return key;
|
||||
}
|
||||
return `${key}="${encode(value)}"`;
|
||||
})
|
||||
.join(" ");
|
||||
}
|
||||
/**
|
||||
* Self-enclosing tags
|
||||
*/
|
||||
const singleTag = new Set([
|
||||
"area",
|
||||
"base",
|
||||
"basefont",
|
||||
"br",
|
||||
"col",
|
||||
"command",
|
||||
"embed",
|
||||
"frame",
|
||||
"hr",
|
||||
"img",
|
||||
"input",
|
||||
"isindex",
|
||||
"keygen",
|
||||
"link",
|
||||
"meta",
|
||||
"param",
|
||||
"source",
|
||||
"track",
|
||||
"wbr",
|
||||
]);
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
export function render(node, options = {}) {
|
||||
const nodes = "length" in node ? node : [node];
|
||||
let output = "";
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
output += renderNode(nodes[i], options);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
export default render;
|
||||
function renderNode(node, options) {
|
||||
switch (node.type) {
|
||||
case ElementType.Root:
|
||||
return render(node.children, options);
|
||||
// @ts-expect-error We don't use `Doctype` yet
|
||||
case ElementType.Doctype:
|
||||
case ElementType.Directive:
|
||||
return renderDirective(node);
|
||||
case ElementType.Comment:
|
||||
return renderComment(node);
|
||||
case ElementType.CDATA:
|
||||
return renderCdata(node);
|
||||
case ElementType.Script:
|
||||
case ElementType.Style:
|
||||
case ElementType.Tag:
|
||||
return renderTag(node, options);
|
||||
case ElementType.Text:
|
||||
return renderText(node, options);
|
||||
}
|
||||
}
|
||||
const foreignModeIntegrationPoints = new Set([
|
||||
"mi",
|
||||
"mo",
|
||||
"mn",
|
||||
"ms",
|
||||
"mtext",
|
||||
"annotation-xml",
|
||||
"foreignObject",
|
||||
"desc",
|
||||
"title",
|
||||
]);
|
||||
const foreignElements = new Set(["svg", "math"]);
|
||||
function renderTag(elem, opts) {
|
||||
var _a;
|
||||
// Handle SVG / MathML in HTML
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case element names */
|
||||
elem.name = (_a = elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
|
||||
/* Exit foreign mode at integration points */
|
||||
if (elem.parent &&
|
||||
foreignModeIntegrationPoints.has(elem.parent.name)) {
|
||||
opts = { ...opts, xmlMode: false };
|
||||
}
|
||||
}
|
||||
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
||||
opts = { ...opts, xmlMode: "foreign" };
|
||||
}
|
||||
let tag = `<${elem.name}`;
|
||||
const attribs = formatAttributes(elem.attribs, opts);
|
||||
if (attribs) {
|
||||
tag += ` ${attribs}`;
|
||||
}
|
||||
if (elem.children.length === 0 &&
|
||||
(opts.xmlMode
|
||||
? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
||||
opts.selfClosingTags !== false
|
||||
: // User explicitly asked for self-closing tags, even in HTML mode
|
||||
opts.selfClosingTags && singleTag.has(elem.name))) {
|
||||
if (!opts.xmlMode)
|
||||
tag += " ";
|
||||
tag += "/>";
|
||||
}
|
||||
else {
|
||||
tag += ">";
|
||||
if (elem.children.length > 0) {
|
||||
tag += render(elem.children, opts);
|
||||
}
|
||||
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
||||
tag += `</${elem.name}>`;
|
||||
}
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
function renderDirective(elem) {
|
||||
return `<${elem.data}>`;
|
||||
}
|
||||
function renderText(elem, opts) {
|
||||
var _a;
|
||||
let data = elem.data || "";
|
||||
// If entities weren't decoded, no need to encode them back
|
||||
if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&
|
||||
!(!opts.xmlMode &&
|
||||
elem.parent &&
|
||||
unencodedElements.has(elem.parent.name))) {
|
||||
data =
|
||||
opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? encodeXML(data)
|
||||
: escapeText(data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
function renderCdata(elem) {
|
||||
return `<![CDATA[${elem.children[0].data}]]>`;
|
||||
}
|
||||
function renderComment(elem) {
|
||||
return `<!--${elem.data}-->`;
|
||||
}
|
||||
1
Frontend-Learner/node_modules/dom-serializer/lib/esm/package.json
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/lib/esm/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"type":"module"}
|
||||
3
Frontend-Learner/node_modules/dom-serializer/lib/foreignNames.d.ts
generated
vendored
Normal file
3
Frontend-Learner/node_modules/dom-serializer/lib/foreignNames.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export declare const elementNames: Map<string, string>;
|
||||
export declare const attributeNames: Map<string, string>;
|
||||
//# sourceMappingURL=foreignNames.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/lib/foreignNames.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/lib/foreignNames.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"foreignNames.d.ts","sourceRoot":"","sources":["../src/foreignNames.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,qBAwCxB,CAAC;AACF,eAAO,MAAM,cAAc,qBA8D1B,CAAC"}
|
||||
103
Frontend-Learner/node_modules/dom-serializer/lib/foreignNames.js
generated
vendored
Normal file
103
Frontend-Learner/node_modules/dom-serializer/lib/foreignNames.js
generated
vendored
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.attributeNames = exports.elementNames = void 0;
|
||||
exports.elementNames = new Map([
|
||||
"altGlyph",
|
||||
"altGlyphDef",
|
||||
"altGlyphItem",
|
||||
"animateColor",
|
||||
"animateMotion",
|
||||
"animateTransform",
|
||||
"clipPath",
|
||||
"feBlend",
|
||||
"feColorMatrix",
|
||||
"feComponentTransfer",
|
||||
"feComposite",
|
||||
"feConvolveMatrix",
|
||||
"feDiffuseLighting",
|
||||
"feDisplacementMap",
|
||||
"feDistantLight",
|
||||
"feDropShadow",
|
||||
"feFlood",
|
||||
"feFuncA",
|
||||
"feFuncB",
|
||||
"feFuncG",
|
||||
"feFuncR",
|
||||
"feGaussianBlur",
|
||||
"feImage",
|
||||
"feMerge",
|
||||
"feMergeNode",
|
||||
"feMorphology",
|
||||
"feOffset",
|
||||
"fePointLight",
|
||||
"feSpecularLighting",
|
||||
"feSpotLight",
|
||||
"feTile",
|
||||
"feTurbulence",
|
||||
"foreignObject",
|
||||
"glyphRef",
|
||||
"linearGradient",
|
||||
"radialGradient",
|
||||
"textPath",
|
||||
].map(function (val) { return [val.toLowerCase(), val]; }));
|
||||
exports.attributeNames = new Map([
|
||||
"definitionURL",
|
||||
"attributeName",
|
||||
"attributeType",
|
||||
"baseFrequency",
|
||||
"baseProfile",
|
||||
"calcMode",
|
||||
"clipPathUnits",
|
||||
"diffuseConstant",
|
||||
"edgeMode",
|
||||
"filterUnits",
|
||||
"glyphRef",
|
||||
"gradientTransform",
|
||||
"gradientUnits",
|
||||
"kernelMatrix",
|
||||
"kernelUnitLength",
|
||||
"keyPoints",
|
||||
"keySplines",
|
||||
"keyTimes",
|
||||
"lengthAdjust",
|
||||
"limitingConeAngle",
|
||||
"markerHeight",
|
||||
"markerUnits",
|
||||
"markerWidth",
|
||||
"maskContentUnits",
|
||||
"maskUnits",
|
||||
"numOctaves",
|
||||
"pathLength",
|
||||
"patternContentUnits",
|
||||
"patternTransform",
|
||||
"patternUnits",
|
||||
"pointsAtX",
|
||||
"pointsAtY",
|
||||
"pointsAtZ",
|
||||
"preserveAlpha",
|
||||
"preserveAspectRatio",
|
||||
"primitiveUnits",
|
||||
"refX",
|
||||
"refY",
|
||||
"repeatCount",
|
||||
"repeatDur",
|
||||
"requiredExtensions",
|
||||
"requiredFeatures",
|
||||
"specularConstant",
|
||||
"specularExponent",
|
||||
"spreadMethod",
|
||||
"startOffset",
|
||||
"stdDeviation",
|
||||
"stitchTiles",
|
||||
"surfaceScale",
|
||||
"systemLanguage",
|
||||
"tableValues",
|
||||
"targetX",
|
||||
"targetY",
|
||||
"textLength",
|
||||
"viewBox",
|
||||
"viewTarget",
|
||||
"xChannelSelector",
|
||||
"yChannelSelector",
|
||||
"zoomAndPan",
|
||||
].map(function (val) { return [val.toLowerCase(), val]; }));
|
||||
52
Frontend-Learner/node_modules/dom-serializer/lib/index.d.ts
generated
vendored
Normal file
52
Frontend-Learner/node_modules/dom-serializer/lib/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import type { AnyNode } from "domhandler";
|
||||
export interface DomSerializerOptions {
|
||||
/**
|
||||
* Print an empty attribute's value.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
|
||||
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
|
||||
*/
|
||||
emptyAttrs?: boolean;
|
||||
/**
|
||||
* Print self-closing tags for tags without contents.
|
||||
*
|
||||
* @default xmlMode
|
||||
* @example With <code>selfClosingTags: false</code>: <code><foo></foo></code>
|
||||
* @example With <code>selfClosingTags: true</code>: <code><foo /></code>
|
||||
*/
|
||||
selfClosingTags?: boolean;
|
||||
/**
|
||||
* Treat the input as an XML document; enables the `emptyAttrs` and `selfClosingTags` options.
|
||||
*
|
||||
* If the value is `"foreign"`, it will try to correct mixed-case attribute names.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean | "foreign";
|
||||
/**
|
||||
* Encode characters that are either reserved in HTML or XML.
|
||||
*
|
||||
* If `xmlMode` is `true` or the value not `'utf8'`, characters outside of the utf8 range will be encoded as well.
|
||||
*
|
||||
* @default `decodeEntities`
|
||||
*/
|
||||
encodeEntities?: boolean | "utf8";
|
||||
/**
|
||||
* Option inherited from parsing; will be used as the default value for `encodeEntities`.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
decodeEntities?: boolean;
|
||||
}
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
export declare function render(node: AnyNode | ArrayLike<AnyNode>, options?: DomSerializerOptions): string;
|
||||
export default render;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/lib/index.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/lib/index.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,OAAO,EAMR,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AA4ED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,EAClC,OAAO,GAAE,oBAAyB,GACjC,MAAM,CAUR;AAED,eAAe,MAAM,CAAC"}
|
||||
229
Frontend-Learner/node_modules/dom-serializer/lib/index.js
generated
vendored
Normal file
229
Frontend-Learner/node_modules/dom-serializer/lib/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.render = void 0;
|
||||
/*
|
||||
* Module dependencies
|
||||
*/
|
||||
var ElementType = __importStar(require("domelementtype"));
|
||||
var entities_1 = require("entities");
|
||||
/**
|
||||
* Mixed-case SVG and MathML tags & attributes
|
||||
* recognized by the HTML parser.
|
||||
*
|
||||
* @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
||||
*/
|
||||
var foreignNames_js_1 = require("./foreignNames.js");
|
||||
var unencodedElements = new Set([
|
||||
"style",
|
||||
"script",
|
||||
"xmp",
|
||||
"iframe",
|
||||
"noembed",
|
||||
"noframes",
|
||||
"plaintext",
|
||||
"noscript",
|
||||
]);
|
||||
function replaceQuotes(value) {
|
||||
return value.replace(/"/g, """);
|
||||
}
|
||||
/**
|
||||
* Format attributes
|
||||
*/
|
||||
function formatAttributes(attributes, opts) {
|
||||
var _a;
|
||||
if (!attributes)
|
||||
return;
|
||||
var encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false
|
||||
? replaceQuotes
|
||||
: opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? entities_1.encodeXML
|
||||
: entities_1.escapeAttribute;
|
||||
return Object.keys(attributes)
|
||||
.map(function (key) {
|
||||
var _a, _b;
|
||||
var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case attribute names */
|
||||
key = (_b = foreignNames_js_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
|
||||
}
|
||||
if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
|
||||
return key;
|
||||
}
|
||||
return "".concat(key, "=\"").concat(encode(value), "\"");
|
||||
})
|
||||
.join(" ");
|
||||
}
|
||||
/**
|
||||
* Self-enclosing tags
|
||||
*/
|
||||
var singleTag = new Set([
|
||||
"area",
|
||||
"base",
|
||||
"basefont",
|
||||
"br",
|
||||
"col",
|
||||
"command",
|
||||
"embed",
|
||||
"frame",
|
||||
"hr",
|
||||
"img",
|
||||
"input",
|
||||
"isindex",
|
||||
"keygen",
|
||||
"link",
|
||||
"meta",
|
||||
"param",
|
||||
"source",
|
||||
"track",
|
||||
"wbr",
|
||||
]);
|
||||
/**
|
||||
* Renders a DOM node or an array of DOM nodes to a string.
|
||||
*
|
||||
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||
*
|
||||
* @param node Node to be rendered.
|
||||
* @param options Changes serialization behavior
|
||||
*/
|
||||
function render(node, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
var nodes = "length" in node ? node : [node];
|
||||
var output = "";
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
output += renderNode(nodes[i], options);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
exports.render = render;
|
||||
exports.default = render;
|
||||
function renderNode(node, options) {
|
||||
switch (node.type) {
|
||||
case ElementType.Root:
|
||||
return render(node.children, options);
|
||||
// @ts-expect-error We don't use `Doctype` yet
|
||||
case ElementType.Doctype:
|
||||
case ElementType.Directive:
|
||||
return renderDirective(node);
|
||||
case ElementType.Comment:
|
||||
return renderComment(node);
|
||||
case ElementType.CDATA:
|
||||
return renderCdata(node);
|
||||
case ElementType.Script:
|
||||
case ElementType.Style:
|
||||
case ElementType.Tag:
|
||||
return renderTag(node, options);
|
||||
case ElementType.Text:
|
||||
return renderText(node, options);
|
||||
}
|
||||
}
|
||||
var foreignModeIntegrationPoints = new Set([
|
||||
"mi",
|
||||
"mo",
|
||||
"mn",
|
||||
"ms",
|
||||
"mtext",
|
||||
"annotation-xml",
|
||||
"foreignObject",
|
||||
"desc",
|
||||
"title",
|
||||
]);
|
||||
var foreignElements = new Set(["svg", "math"]);
|
||||
function renderTag(elem, opts) {
|
||||
var _a;
|
||||
// Handle SVG / MathML in HTML
|
||||
if (opts.xmlMode === "foreign") {
|
||||
/* Fix up mixed-case element names */
|
||||
elem.name = (_a = foreignNames_js_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;
|
||||
/* Exit foreign mode at integration points */
|
||||
if (elem.parent &&
|
||||
foreignModeIntegrationPoints.has(elem.parent.name)) {
|
||||
opts = __assign(__assign({}, opts), { xmlMode: false });
|
||||
}
|
||||
}
|
||||
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
||||
opts = __assign(__assign({}, opts), { xmlMode: "foreign" });
|
||||
}
|
||||
var tag = "<".concat(elem.name);
|
||||
var attribs = formatAttributes(elem.attribs, opts);
|
||||
if (attribs) {
|
||||
tag += " ".concat(attribs);
|
||||
}
|
||||
if (elem.children.length === 0 &&
|
||||
(opts.xmlMode
|
||||
? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
|
||||
opts.selfClosingTags !== false
|
||||
: // User explicitly asked for self-closing tags, even in HTML mode
|
||||
opts.selfClosingTags && singleTag.has(elem.name))) {
|
||||
if (!opts.xmlMode)
|
||||
tag += " ";
|
||||
tag += "/>";
|
||||
}
|
||||
else {
|
||||
tag += ">";
|
||||
if (elem.children.length > 0) {
|
||||
tag += render(elem.children, opts);
|
||||
}
|
||||
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
||||
tag += "</".concat(elem.name, ">");
|
||||
}
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
function renderDirective(elem) {
|
||||
return "<".concat(elem.data, ">");
|
||||
}
|
||||
function renderText(elem, opts) {
|
||||
var _a;
|
||||
var data = elem.data || "";
|
||||
// If entities weren't decoded, no need to encode them back
|
||||
if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&
|
||||
!(!opts.xmlMode &&
|
||||
elem.parent &&
|
||||
unencodedElements.has(elem.parent.name))) {
|
||||
data =
|
||||
opts.xmlMode || opts.encodeEntities !== "utf8"
|
||||
? (0, entities_1.encodeXML)(data)
|
||||
: (0, entities_1.escapeText)(data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
function renderCdata(elem) {
|
||||
return "<![CDATA[".concat(elem.children[0].data, "]]>");
|
||||
}
|
||||
function renderComment(elem) {
|
||||
return "<!--".concat(elem.data, "-->");
|
||||
}
|
||||
11
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/LICENSE
generated
vendored
Normal file
11
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
211
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts
generated
vendored
Normal file
211
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
import htmlDecodeTree from "./generated/decode-data-html.js";
|
||||
import xmlDecodeTree from "./generated/decode-data-xml.js";
|
||||
import decodeCodePoint from "./decode_codepoint.js";
|
||||
export { htmlDecodeTree, xmlDecodeTree, decodeCodePoint };
|
||||
export { replaceCodePoint, fromCodePoint } from "./decode_codepoint.js";
|
||||
export declare enum BinTrieFlags {
|
||||
VALUE_LENGTH = 49152,
|
||||
BRANCH_LENGTH = 16256,
|
||||
JUMP_TABLE = 127
|
||||
}
|
||||
export declare enum DecodingMode {
|
||||
/** Entities in text nodes that can end with any character. */
|
||||
Legacy = 0,
|
||||
/** Only allow entities terminated with a semicolon. */
|
||||
Strict = 1,
|
||||
/** Entities in attributes have limitations on ending characters. */
|
||||
Attribute = 2
|
||||
}
|
||||
/**
|
||||
* Producers for character reference errors as defined in the HTML spec.
|
||||
*/
|
||||
export interface EntityErrorProducer {
|
||||
missingSemicolonAfterCharacterReference(): void;
|
||||
absenceOfDigitsInNumericCharacterReference(consumedCharacters: number): void;
|
||||
validateNumericCharacterReference(code: number): void;
|
||||
}
|
||||
/**
|
||||
* Token decoder with support of writing partial entities.
|
||||
*/
|
||||
export declare class EntityDecoder {
|
||||
/** The tree used to decode entities. */
|
||||
private readonly decodeTree;
|
||||
/**
|
||||
* The function that is called when a codepoint is decoded.
|
||||
*
|
||||
* For multi-byte named entities, this will be called multiple times,
|
||||
* with the second codepoint, and the same `consumed` value.
|
||||
*
|
||||
* @param codepoint The decoded codepoint.
|
||||
* @param consumed The number of bytes consumed by the decoder.
|
||||
*/
|
||||
private readonly emitCodePoint;
|
||||
/** An object that is used to produce errors. */
|
||||
private readonly errors?;
|
||||
constructor(
|
||||
/** The tree used to decode entities. */
|
||||
decodeTree: Uint16Array,
|
||||
/**
|
||||
* The function that is called when a codepoint is decoded.
|
||||
*
|
||||
* For multi-byte named entities, this will be called multiple times,
|
||||
* with the second codepoint, and the same `consumed` value.
|
||||
*
|
||||
* @param codepoint The decoded codepoint.
|
||||
* @param consumed The number of bytes consumed by the decoder.
|
||||
*/
|
||||
emitCodePoint: (cp: number, consumed: number) => void,
|
||||
/** An object that is used to produce errors. */
|
||||
errors?: EntityErrorProducer | undefined);
|
||||
/** The current state of the decoder. */
|
||||
private state;
|
||||
/** Characters that were consumed while parsing an entity. */
|
||||
private consumed;
|
||||
/**
|
||||
* The result of the entity.
|
||||
*
|
||||
* Either the result index of a numeric entity, or the codepoint of a
|
||||
* numeric entity.
|
||||
*/
|
||||
private result;
|
||||
/** The current index in the decode tree. */
|
||||
private treeIndex;
|
||||
/** The number of characters that were consumed in excess. */
|
||||
private excess;
|
||||
/** The mode in which the decoder is operating. */
|
||||
private decodeMode;
|
||||
/** Resets the instance to make it reusable. */
|
||||
startEntity(decodeMode: DecodingMode): void;
|
||||
/**
|
||||
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
||||
* If the entity is incomplete, the decoder will return -1.
|
||||
*
|
||||
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
|
||||
* entity is incomplete, and resume when the next string is written.
|
||||
*
|
||||
* @param string The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
write(str: string, offset: number): number;
|
||||
/**
|
||||
* Switches between the numeric decimal and hexadecimal states.
|
||||
*
|
||||
* Equivalent to the `Numeric character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
private stateNumericStart;
|
||||
private addToNumericResult;
|
||||
/**
|
||||
* Parses a hexadecimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Hexademical character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
private stateNumericHex;
|
||||
/**
|
||||
* Parses a decimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Decimal character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
private stateNumericDecimal;
|
||||
/**
|
||||
* Validate and emit a numeric entity.
|
||||
*
|
||||
* Implements the logic from the `Hexademical character reference start
|
||||
* state` and `Numeric character reference end state` in the HTML spec.
|
||||
*
|
||||
* @param lastCp The last code point of the entity. Used to see if the
|
||||
* entity was terminated with a semicolon.
|
||||
* @param expectedLength The minimum number of characters that should be
|
||||
* consumed. Used to validate that at least one digit
|
||||
* was consumed.
|
||||
* @returns The number of characters that were consumed.
|
||||
*/
|
||||
private emitNumericEntity;
|
||||
/**
|
||||
* Parses a named entity.
|
||||
*
|
||||
* Equivalent to the `Named character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
private stateNamedEntity;
|
||||
/**
|
||||
* Emit a named entity that was not terminated with a semicolon.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
private emitNotTerminatedNamedEntity;
|
||||
/**
|
||||
* Emit a named entity.
|
||||
*
|
||||
* @param result The index of the entity in the decode tree.
|
||||
* @param valueLength The number of bytes in the entity.
|
||||
* @param consumed The number of characters consumed.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
private emitNamedEntityData;
|
||||
/**
|
||||
* Signal to the parser that the end of the input was reached.
|
||||
*
|
||||
* Remaining data will be emitted and relevant errors will be produced.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
end(): number;
|
||||
}
|
||||
/**
|
||||
* Determines the branch of the current node that is taken given the current
|
||||
* character. This function is used to traverse the trie.
|
||||
*
|
||||
* @param decodeTree The trie.
|
||||
* @param current The current node.
|
||||
* @param nodeIdx The index right after the current node and its value.
|
||||
* @param char The current character.
|
||||
* @returns The index of the next node, or -1 if no branch is taken.
|
||||
*/
|
||||
export declare function determineBranch(decodeTree: Uint16Array, current: number, nodeIdx: number, char: number): number;
|
||||
/**
|
||||
* Decodes an HTML string.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @param mode The decoding mode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export declare function decodeHTML(str: string, mode?: DecodingMode): string;
|
||||
/**
|
||||
* Decodes an HTML string in an attribute.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export declare function decodeHTMLAttribute(str: string): string;
|
||||
/**
|
||||
* Decodes an HTML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export declare function decodeHTMLStrict(str: string): string;
|
||||
/**
|
||||
* Decodes an XML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export declare function decodeXML(str: string): string;
|
||||
//# sourceMappingURL=decode.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,eAGN,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAoBxE,oBAAY,YAAY;IACpB,YAAY,QAAwB;IACpC,aAAa,QAAwB;IACrC,UAAU,MAAwB;CACrC;AAuCD,oBAAY,YAAY;IACpB,8DAA8D;IAC9D,MAAM,IAAI;IACV,uDAAuD;IACvD,MAAM,IAAI;IACV,oEAAoE;IACpE,SAAS,IAAI;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,uCAAuC,IAAI,IAAI,CAAC;IAChD,0CAA0C,CACtC,k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AYpC;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;;;;;OAMG;IACH,GAAG,IAAI,MAAM;CA6BhB;AAoDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,WAAW,EACvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACb,MAAM,CAsCR;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,eAAsB,GAAG,MAAM,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
||||
536
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode.js
generated
vendored
Normal file
536
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode.js
generated
vendored
Normal file
|
|
@ -0,0 +1,536 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTMLAttribute = exports.decodeHTML = exports.determineBranch = exports.EntityDecoder = exports.DecodingMode = exports.BinTrieFlags = exports.fromCodePoint = exports.replaceCodePoint = exports.decodeCodePoint = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0;
|
||||
var decode_data_html_js_1 = __importDefault(require("./generated/decode-data-html.js"));
|
||||
exports.htmlDecodeTree = decode_data_html_js_1.default;
|
||||
var decode_data_xml_js_1 = __importDefault(require("./generated/decode-data-xml.js"));
|
||||
exports.xmlDecodeTree = decode_data_xml_js_1.default;
|
||||
var decode_codepoint_js_1 = __importStar(require("./decode_codepoint.js"));
|
||||
exports.decodeCodePoint = decode_codepoint_js_1.default;
|
||||
var decode_codepoint_js_2 = require("./decode_codepoint.js");
|
||||
Object.defineProperty(exports, "replaceCodePoint", { enumerable: true, get: function () { return decode_codepoint_js_2.replaceCodePoint; } });
|
||||
Object.defineProperty(exports, "fromCodePoint", { enumerable: true, get: function () { return decode_codepoint_js_2.fromCodePoint; } });
|
||||
var CharCodes;
|
||||
(function (CharCodes) {
|
||||
CharCodes[CharCodes["NUM"] = 35] = "NUM";
|
||||
CharCodes[CharCodes["SEMI"] = 59] = "SEMI";
|
||||
CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS";
|
||||
CharCodes[CharCodes["ZERO"] = 48] = "ZERO";
|
||||
CharCodes[CharCodes["NINE"] = 57] = "NINE";
|
||||
CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A";
|
||||
CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F";
|
||||
CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X";
|
||||
CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z";
|
||||
CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A";
|
||||
CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F";
|
||||
CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z";
|
||||
})(CharCodes || (CharCodes = {}));
|
||||
/** Bit that needs to be set to convert an upper case ASCII character to lower case */
|
||||
var TO_LOWER_BIT = 32;
|
||||
var BinTrieFlags;
|
||||
(function (BinTrieFlags) {
|
||||
BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
|
||||
BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH";
|
||||
BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
|
||||
})(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {}));
|
||||
function isNumber(code) {
|
||||
return code >= CharCodes.ZERO && code <= CharCodes.NINE;
|
||||
}
|
||||
function isHexadecimalCharacter(code) {
|
||||
return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||
|
||||
(code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F));
|
||||
}
|
||||
function isAsciiAlphaNumeric(code) {
|
||||
return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||
|
||||
(code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||
|
||||
isNumber(code));
|
||||
}
|
||||
/**
|
||||
* Checks if the given character is a valid end character for an entity in an attribute.
|
||||
*
|
||||
* Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.
|
||||
* See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
|
||||
*/
|
||||
function isEntityInAttributeInvalidEnd(code) {
|
||||
return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
|
||||
}
|
||||
var EntityDecoderState;
|
||||
(function (EntityDecoderState) {
|
||||
EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart";
|
||||
EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart";
|
||||
EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal";
|
||||
EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex";
|
||||
EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity";
|
||||
})(EntityDecoderState || (EntityDecoderState = {}));
|
||||
var DecodingMode;
|
||||
(function (DecodingMode) {
|
||||
/** Entities in text nodes that can end with any character. */
|
||||
DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
|
||||
/** Only allow entities terminated with a semicolon. */
|
||||
DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
|
||||
/** Entities in attributes have limitations on ending characters. */
|
||||
DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
|
||||
})(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {}));
|
||||
/**
|
||||
* Token decoder with support of writing partial entities.
|
||||
*/
|
||||
var EntityDecoder = /** @class */ (function () {
|
||||
function EntityDecoder(
|
||||
/** The tree used to decode entities. */
|
||||
decodeTree,
|
||||
/**
|
||||
* The function that is called when a codepoint is decoded.
|
||||
*
|
||||
* For multi-byte named entities, this will be called multiple times,
|
||||
* with the second codepoint, and the same `consumed` value.
|
||||
*
|
||||
* @param codepoint The decoded codepoint.
|
||||
* @param consumed The number of bytes consumed by the decoder.
|
||||
*/
|
||||
emitCodePoint,
|
||||
/** An object that is used to produce errors. */
|
||||
errors) {
|
||||
this.decodeTree = decodeTree;
|
||||
this.emitCodePoint = emitCodePoint;
|
||||
this.errors = errors;
|
||||
/** The current state of the decoder. */
|
||||
this.state = EntityDecoderState.EntityStart;
|
||||
/** Characters that were consumed while parsing an entity. */
|
||||
this.consumed = 1;
|
||||
/**
|
||||
* The result of the entity.
|
||||
*
|
||||
* Either the result index of a numeric entity, or the codepoint of a
|
||||
* numeric entity.
|
||||
*/
|
||||
this.result = 0;
|
||||
/** The current index in the decode tree. */
|
||||
this.treeIndex = 0;
|
||||
/** The number of characters that were consumed in excess. */
|
||||
this.excess = 1;
|
||||
/** The mode in which the decoder is operating. */
|
||||
this.decodeMode = DecodingMode.Strict;
|
||||
}
|
||||
/** Resets the instance to make it reusable. */
|
||||
EntityDecoder.prototype.startEntity = function (decodeMode) {
|
||||
this.decodeMode = decodeMode;
|
||||
this.state = EntityDecoderState.EntityStart;
|
||||
this.result = 0;
|
||||
this.treeIndex = 0;
|
||||
this.excess = 1;
|
||||
this.consumed = 1;
|
||||
};
|
||||
/**
|
||||
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
||||
* If the entity is incomplete, the decoder will return -1.
|
||||
*
|
||||
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
|
||||
* entity is incomplete, and resume when the next string is written.
|
||||
*
|
||||
* @param string The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
EntityDecoder.prototype.write = function (str, offset) {
|
||||
switch (this.state) {
|
||||
case EntityDecoderState.EntityStart: {
|
||||
if (str.charCodeAt(offset) === CharCodes.NUM) {
|
||||
this.state = EntityDecoderState.NumericStart;
|
||||
this.consumed += 1;
|
||||
return this.stateNumericStart(str, offset + 1);
|
||||
}
|
||||
this.state = EntityDecoderState.NamedEntity;
|
||||
return this.stateNamedEntity(str, offset);
|
||||
}
|
||||
case EntityDecoderState.NumericStart: {
|
||||
return this.stateNumericStart(str, offset);
|
||||
}
|
||||
case EntityDecoderState.NumericDecimal: {
|
||||
return this.stateNumericDecimal(str, offset);
|
||||
}
|
||||
case EntityDecoderState.NumericHex: {
|
||||
return this.stateNumericHex(str, offset);
|
||||
}
|
||||
case EntityDecoderState.NamedEntity: {
|
||||
return this.stateNamedEntity(str, offset);
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Switches between the numeric decimal and hexadecimal states.
|
||||
*
|
||||
* Equivalent to the `Numeric character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
EntityDecoder.prototype.stateNumericStart = function (str, offset) {
|
||||
if (offset >= str.length) {
|
||||
return -1;
|
||||
}
|
||||
if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
|
||||
this.state = EntityDecoderState.NumericHex;
|
||||
this.consumed += 1;
|
||||
return this.stateNumericHex(str, offset + 1);
|
||||
}
|
||||
this.state = EntityDecoderState.NumericDecimal;
|
||||
return this.stateNumericDecimal(str, offset);
|
||||
};
|
||||
EntityDecoder.prototype.addToNumericResult = function (str, start, end, base) {
|
||||
if (start !== end) {
|
||||
var digitCount = end - start;
|
||||
this.result =
|
||||
this.result * Math.pow(base, digitCount) +
|
||||
parseInt(str.substr(start, digitCount), base);
|
||||
this.consumed += digitCount;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Parses a hexadecimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Hexademical character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
EntityDecoder.prototype.stateNumericHex = function (str, offset) {
|
||||
var startIdx = offset;
|
||||
while (offset < str.length) {
|
||||
var char = str.charCodeAt(offset);
|
||||
if (isNumber(char) || isHexadecimalCharacter(char)) {
|
||||
offset += 1;
|
||||
}
|
||||
else {
|
||||
this.addToNumericResult(str, startIdx, offset, 16);
|
||||
return this.emitNumericEntity(char, 3);
|
||||
}
|
||||
}
|
||||
this.addToNumericResult(str, startIdx, offset, 16);
|
||||
return -1;
|
||||
};
|
||||
/**
|
||||
* Parses a decimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Decimal character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
EntityDecoder.prototype.stateNumericDecimal = function (str, offset) {
|
||||
var startIdx = offset;
|
||||
while (offset < str.length) {
|
||||
var char = str.charCodeAt(offset);
|
||||
if (isNumber(char)) {
|
||||
offset += 1;
|
||||
}
|
||||
else {
|
||||
this.addToNumericResult(str, startIdx, offset, 10);
|
||||
return this.emitNumericEntity(char, 2);
|
||||
}
|
||||
}
|
||||
this.addToNumericResult(str, startIdx, offset, 10);
|
||||
return -1;
|
||||
};
|
||||
/**
|
||||
* Validate and emit a numeric entity.
|
||||
*
|
||||
* Implements the logic from the `Hexademical character reference start
|
||||
* state` and `Numeric character reference end state` in the HTML spec.
|
||||
*
|
||||
* @param lastCp The last code point of the entity. Used to see if the
|
||||
* entity was terminated with a semicolon.
|
||||
* @param expectedLength The minimum number of characters that should be
|
||||
* consumed. Used to validate that at least one digit
|
||||
* was consumed.
|
||||
* @returns The number of characters that were consumed.
|
||||
*/
|
||||
EntityDecoder.prototype.emitNumericEntity = function (lastCp, expectedLength) {
|
||||
var _a;
|
||||
// Ensure we consumed at least one digit.
|
||||
if (this.consumed <= expectedLength) {
|
||||
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
||||
return 0;
|
||||
}
|
||||
// Figure out if this is a legit end of the entity
|
||||
if (lastCp === CharCodes.SEMI) {
|
||||
this.consumed += 1;
|
||||
}
|
||||
else if (this.decodeMode === DecodingMode.Strict) {
|
||||
return 0;
|
||||
}
|
||||
this.emitCodePoint((0, decode_codepoint_js_1.replaceCodePoint)(this.result), this.consumed);
|
||||
if (this.errors) {
|
||||
if (lastCp !== CharCodes.SEMI) {
|
||||
this.errors.missingSemicolonAfterCharacterReference();
|
||||
}
|
||||
this.errors.validateNumericCharacterReference(this.result);
|
||||
}
|
||||
return this.consumed;
|
||||
};
|
||||
/**
|
||||
* Parses a named entity.
|
||||
*
|
||||
* Equivalent to the `Named character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
EntityDecoder.prototype.stateNamedEntity = function (str, offset) {
|
||||
var decodeTree = this.decodeTree;
|
||||
var current = decodeTree[this.treeIndex];
|
||||
// The mask is the number of bytes of the value, including the current byte.
|
||||
var valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
for (; offset < str.length; offset++, this.excess++) {
|
||||
var char = str.charCodeAt(offset);
|
||||
this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
|
||||
if (this.treeIndex < 0) {
|
||||
return this.result === 0 ||
|
||||
// If we are parsing an attribute
|
||||
(this.decodeMode === DecodingMode.Attribute &&
|
||||
// We shouldn't have consumed any characters after the entity,
|
||||
(valueLength === 0 ||
|
||||
// And there should be no invalid characters.
|
||||
isEntityInAttributeInvalidEnd(char)))
|
||||
? 0
|
||||
: this.emitNotTerminatedNamedEntity();
|
||||
}
|
||||
current = decodeTree[this.treeIndex];
|
||||
valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
// If the branch is a value, store it and continue
|
||||
if (valueLength !== 0) {
|
||||
// If the entity is terminated by a semicolon, we are done.
|
||||
if (char === CharCodes.SEMI) {
|
||||
return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
|
||||
}
|
||||
// If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.
|
||||
if (this.decodeMode !== DecodingMode.Strict) {
|
||||
this.result = this.treeIndex;
|
||||
this.consumed += this.excess;
|
||||
this.excess = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
/**
|
||||
* Emit a named entity that was not terminated with a semicolon.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
EntityDecoder.prototype.emitNotTerminatedNamedEntity = function () {
|
||||
var _a;
|
||||
var _b = this, result = _b.result, decodeTree = _b.decodeTree;
|
||||
var valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
this.emitNamedEntityData(result, valueLength, this.consumed);
|
||||
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();
|
||||
return this.consumed;
|
||||
};
|
||||
/**
|
||||
* Emit a named entity.
|
||||
*
|
||||
* @param result The index of the entity in the decode tree.
|
||||
* @param valueLength The number of bytes in the entity.
|
||||
* @param consumed The number of characters consumed.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
EntityDecoder.prototype.emitNamedEntityData = function (result, valueLength, consumed) {
|
||||
var decodeTree = this.decodeTree;
|
||||
this.emitCodePoint(valueLength === 1
|
||||
? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH
|
||||
: decodeTree[result + 1], consumed);
|
||||
if (valueLength === 3) {
|
||||
// For multi-byte values, we need to emit the second byte.
|
||||
this.emitCodePoint(decodeTree[result + 2], consumed);
|
||||
}
|
||||
return consumed;
|
||||
};
|
||||
/**
|
||||
* Signal to the parser that the end of the input was reached.
|
||||
*
|
||||
* Remaining data will be emitted and relevant errors will be produced.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
EntityDecoder.prototype.end = function () {
|
||||
var _a;
|
||||
switch (this.state) {
|
||||
case EntityDecoderState.NamedEntity: {
|
||||
// Emit a named entity if we have one.
|
||||
return this.result !== 0 &&
|
||||
(this.decodeMode !== DecodingMode.Attribute ||
|
||||
this.result === this.treeIndex)
|
||||
? this.emitNotTerminatedNamedEntity()
|
||||
: 0;
|
||||
}
|
||||
// Otherwise, emit a numeric entity if we have one.
|
||||
case EntityDecoderState.NumericDecimal: {
|
||||
return this.emitNumericEntity(0, 2);
|
||||
}
|
||||
case EntityDecoderState.NumericHex: {
|
||||
return this.emitNumericEntity(0, 3);
|
||||
}
|
||||
case EntityDecoderState.NumericStart: {
|
||||
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
||||
return 0;
|
||||
}
|
||||
case EntityDecoderState.EntityStart: {
|
||||
// Return 0 if we have no entity.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
return EntityDecoder;
|
||||
}());
|
||||
exports.EntityDecoder = EntityDecoder;
|
||||
/**
|
||||
* Creates a function that decodes entities in a string.
|
||||
*
|
||||
* @param decodeTree The decode tree.
|
||||
* @returns A function that decodes entities in a string.
|
||||
*/
|
||||
function getDecoder(decodeTree) {
|
||||
var ret = "";
|
||||
var decoder = new EntityDecoder(decodeTree, function (str) { return (ret += (0, decode_codepoint_js_1.fromCodePoint)(str)); });
|
||||
return function decodeWithTrie(str, decodeMode) {
|
||||
var lastIndex = 0;
|
||||
var offset = 0;
|
||||
while ((offset = str.indexOf("&", offset)) >= 0) {
|
||||
ret += str.slice(lastIndex, offset);
|
||||
decoder.startEntity(decodeMode);
|
||||
var len = decoder.write(str,
|
||||
// Skip the "&"
|
||||
offset + 1);
|
||||
if (len < 0) {
|
||||
lastIndex = offset + decoder.end();
|
||||
break;
|
||||
}
|
||||
lastIndex = offset + len;
|
||||
// If `len` is 0, skip the current `&` and continue.
|
||||
offset = len === 0 ? lastIndex + 1 : lastIndex;
|
||||
}
|
||||
var result = ret + str.slice(lastIndex);
|
||||
// Make sure we don't keep a reference to the final string.
|
||||
ret = "";
|
||||
return result;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Determines the branch of the current node that is taken given the current
|
||||
* character. This function is used to traverse the trie.
|
||||
*
|
||||
* @param decodeTree The trie.
|
||||
* @param current The current node.
|
||||
* @param nodeIdx The index right after the current node and its value.
|
||||
* @param char The current character.
|
||||
* @returns The index of the next node, or -1 if no branch is taken.
|
||||
*/
|
||||
function determineBranch(decodeTree, current, nodeIdx, char) {
|
||||
var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
|
||||
var jumpOffset = current & BinTrieFlags.JUMP_TABLE;
|
||||
// Case 1: Single branch encoded in jump offset
|
||||
if (branchCount === 0) {
|
||||
return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;
|
||||
}
|
||||
// Case 2: Multiple branches encoded in jump table
|
||||
if (jumpOffset) {
|
||||
var value = char - jumpOffset;
|
||||
return value < 0 || value >= branchCount
|
||||
? -1
|
||||
: decodeTree[nodeIdx + value] - 1;
|
||||
}
|
||||
// Case 3: Multiple branches encoded in dictionary
|
||||
// Binary search for the character.
|
||||
var lo = nodeIdx;
|
||||
var hi = lo + branchCount - 1;
|
||||
while (lo <= hi) {
|
||||
var mid = (lo + hi) >>> 1;
|
||||
var midVal = decodeTree[mid];
|
||||
if (midVal < char) {
|
||||
lo = mid + 1;
|
||||
}
|
||||
else if (midVal > char) {
|
||||
hi = mid - 1;
|
||||
}
|
||||
else {
|
||||
return decodeTree[mid + branchCount];
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
exports.determineBranch = determineBranch;
|
||||
var htmlDecoder = getDecoder(decode_data_html_js_1.default);
|
||||
var xmlDecoder = getDecoder(decode_data_xml_js_1.default);
|
||||
/**
|
||||
* Decodes an HTML string.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @param mode The decoding mode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
function decodeHTML(str, mode) {
|
||||
if (mode === void 0) { mode = DecodingMode.Legacy; }
|
||||
return htmlDecoder(str, mode);
|
||||
}
|
||||
exports.decodeHTML = decodeHTML;
|
||||
/**
|
||||
* Decodes an HTML string in an attribute.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
function decodeHTMLAttribute(str) {
|
||||
return htmlDecoder(str, DecodingMode.Attribute);
|
||||
}
|
||||
exports.decodeHTMLAttribute = decodeHTMLAttribute;
|
||||
/**
|
||||
* Decodes an HTML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
function decodeHTMLStrict(str) {
|
||||
return htmlDecoder(str, DecodingMode.Strict);
|
||||
}
|
||||
exports.decodeHTMLStrict = decodeHTMLStrict;
|
||||
/**
|
||||
* Decodes an XML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
function decodeXML(str) {
|
||||
return xmlDecoder(str, DecodingMode.Strict);
|
||||
}
|
||||
exports.decodeXML = decodeXML;
|
||||
//# sourceMappingURL=decode.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts
generated
vendored
Normal file
19
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
|
||||
*/
|
||||
export declare const fromCodePoint: (...codePoints: number[]) => string;
|
||||
/**
|
||||
* Replace the given code point with a replacement character if it is a
|
||||
* surrogate or is outside the valid range. Otherwise return the code
|
||||
* point unchanged.
|
||||
*/
|
||||
export declare function replaceCodePoint(codePoint: number): number;
|
||||
/**
|
||||
* Replace the code point if relevant, then convert it to a string.
|
||||
*
|
||||
* @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
|
||||
* @param codePoint The code point to decode.
|
||||
* @returns The decoded code point.
|
||||
*/
|
||||
export default function decodeCodePoint(codePoint: number): string;
|
||||
//# sourceMappingURL=decode_codepoint.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode_codepoint.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_codepoint.ts"],"names":[],"mappings":"AAkCA;;GAEG;AACH,eAAO,MAAM,aAAa,qCAgBrB,CAAC;AAEN;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,UAMjD;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE"}
|
||||
76
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js
generated
vendored
Normal file
76
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js
generated
vendored
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
"use strict";
|
||||
// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.replaceCodePoint = exports.fromCodePoint = void 0;
|
||||
var decodeMap = new Map([
|
||||
[0, 65533],
|
||||
// C1 Unicode control character reference replacements
|
||||
[128, 8364],
|
||||
[130, 8218],
|
||||
[131, 402],
|
||||
[132, 8222],
|
||||
[133, 8230],
|
||||
[134, 8224],
|
||||
[135, 8225],
|
||||
[136, 710],
|
||||
[137, 8240],
|
||||
[138, 352],
|
||||
[139, 8249],
|
||||
[140, 338],
|
||||
[142, 381],
|
||||
[145, 8216],
|
||||
[146, 8217],
|
||||
[147, 8220],
|
||||
[148, 8221],
|
||||
[149, 8226],
|
||||
[150, 8211],
|
||||
[151, 8212],
|
||||
[152, 732],
|
||||
[153, 8482],
|
||||
[154, 353],
|
||||
[155, 8250],
|
||||
[156, 339],
|
||||
[158, 382],
|
||||
[159, 376],
|
||||
]);
|
||||
/**
|
||||
* Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
|
||||
*/
|
||||
exports.fromCodePoint =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
||||
(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {
|
||||
var output = "";
|
||||
if (codePoint > 0xffff) {
|
||||
codePoint -= 0x10000;
|
||||
output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);
|
||||
codePoint = 0xdc00 | (codePoint & 0x3ff);
|
||||
}
|
||||
output += String.fromCharCode(codePoint);
|
||||
return output;
|
||||
};
|
||||
/**
|
||||
* Replace the given code point with a replacement character if it is a
|
||||
* surrogate or is outside the valid range. Otherwise return the code
|
||||
* point unchanged.
|
||||
*/
|
||||
function replaceCodePoint(codePoint) {
|
||||
var _a;
|
||||
if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
|
||||
return 0xfffd;
|
||||
}
|
||||
return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;
|
||||
}
|
||||
exports.replaceCodePoint = replaceCodePoint;
|
||||
/**
|
||||
* Replace the code point if relevant, then convert it to a string.
|
||||
*
|
||||
* @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
|
||||
* @param codePoint The code point to decode.
|
||||
* @returns The decoded code point.
|
||||
*/
|
||||
function decodeCodePoint(codePoint) {
|
||||
return (0, exports.fromCodePoint)(replaceCodePoint(codePoint));
|
||||
}
|
||||
exports.default = decodeCodePoint;
|
||||
//# sourceMappingURL=decode_codepoint.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode_codepoint.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_codepoint.ts"],"names":[],"mappings":";AAAA,qHAAqH;;;;AAErH,IAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACtB,CAAC,CAAC,EAAE,KAAK,CAAC;IACV,sDAAsD;IACtD,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,IAAI,CAAC;IACX,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;IACV,CAAC,GAAG,EAAE,GAAG,CAAC;CACb,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,aAAa;AACtB,iHAAiH;AACjH,MAAA,MAAM,CAAC,aAAa,mCACpB,UAAU,SAAiB;IACvB,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,IAAI,SAAS,GAAG,MAAM,EAAE;QACpB,SAAS,IAAI,OAAO,CAAC;QACrB,MAAM,IAAI,MAAM,CAAC,YAAY,CACzB,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CACxC,CAAC;QACF,SAAS,GAAG,MAAM,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;KAC5C;IAED,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEN;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,SAAiB;;IAC9C,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,SAAS,GAAG,QAAQ,EAAE;QACtE,OAAO,MAAM,CAAC;KACjB;IAED,OAAO,MAAA,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAI,SAAS,CAAC;AACjD,CAAC;AAND,4CAMC;AAED;;;;;;GAMG;AACH,SAAwB,eAAe,CAAC,SAAiB;IACrD,OAAO,IAAA,qBAAa,EAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD,CAAC;AAFD,kCAEC"}
|
||||
22
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts
generated
vendored
Normal file
22
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Encodes all characters in the input using HTML entities. This includes
|
||||
* characters that are valid ASCII characters in HTML documents, such as `#`.
|
||||
*
|
||||
* To get a more compact output, consider using the `encodeNonAsciiHTML`
|
||||
* function, which will only encode characters that are not valid in HTML
|
||||
* documents, as well as non-ASCII characters.
|
||||
*
|
||||
* If a character has no equivalent entity, a numeric hexadecimal reference
|
||||
* (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare function encodeHTML(data: string): string;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
||||
* documents using HTML entities. This function will not encode characters that
|
||||
* are valid in HTML documents, such as `#`.
|
||||
*
|
||||
* If a character has no equivalent entity, a numeric hexadecimal reference
|
||||
* (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare function encodeNonAsciiHTML(data: string): string;
|
||||
//# sourceMappingURL=encode.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"encode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AACD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD"}
|
||||
77
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/encode.js
generated
vendored
Normal file
77
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/encode.js
generated
vendored
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.encodeNonAsciiHTML = exports.encodeHTML = void 0;
|
||||
var encode_html_js_1 = __importDefault(require("./generated/encode-html.js"));
|
||||
var escape_js_1 = require("./escape.js");
|
||||
var htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;
|
||||
/**
|
||||
* Encodes all characters in the input using HTML entities. This includes
|
||||
* characters that are valid ASCII characters in HTML documents, such as `#`.
|
||||
*
|
||||
* To get a more compact output, consider using the `encodeNonAsciiHTML`
|
||||
* function, which will only encode characters that are not valid in HTML
|
||||
* documents, as well as non-ASCII characters.
|
||||
*
|
||||
* If a character has no equivalent entity, a numeric hexadecimal reference
|
||||
* (eg. `ü`) will be used.
|
||||
*/
|
||||
function encodeHTML(data) {
|
||||
return encodeHTMLTrieRe(htmlReplacer, data);
|
||||
}
|
||||
exports.encodeHTML = encodeHTML;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
||||
* documents using HTML entities. This function will not encode characters that
|
||||
* are valid in HTML documents, such as `#`.
|
||||
*
|
||||
* If a character has no equivalent entity, a numeric hexadecimal reference
|
||||
* (eg. `ü`) will be used.
|
||||
*/
|
||||
function encodeNonAsciiHTML(data) {
|
||||
return encodeHTMLTrieRe(escape_js_1.xmlReplacer, data);
|
||||
}
|
||||
exports.encodeNonAsciiHTML = encodeNonAsciiHTML;
|
||||
function encodeHTMLTrieRe(regExp, str) {
|
||||
var ret = "";
|
||||
var lastIdx = 0;
|
||||
var match;
|
||||
while ((match = regExp.exec(str)) !== null) {
|
||||
var i = match.index;
|
||||
ret += str.substring(lastIdx, i);
|
||||
var char = str.charCodeAt(i);
|
||||
var next = encode_html_js_1.default.get(char);
|
||||
if (typeof next === "object") {
|
||||
// We are in a branch. Try to match the next char.
|
||||
if (i + 1 < str.length) {
|
||||
var nextChar = str.charCodeAt(i + 1);
|
||||
var value = typeof next.n === "number"
|
||||
? next.n === nextChar
|
||||
? next.o
|
||||
: undefined
|
||||
: next.n.get(nextChar);
|
||||
if (value !== undefined) {
|
||||
ret += value;
|
||||
lastIdx = regExp.lastIndex += 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
next = next.v;
|
||||
}
|
||||
// We might have a tree node without a value; skip and use a numeric entity.
|
||||
if (next !== undefined) {
|
||||
ret += next;
|
||||
lastIdx = i + 1;
|
||||
}
|
||||
else {
|
||||
var cp = (0, escape_js_1.getCodePoint)(str, i);
|
||||
ret += "&#x".concat(cp.toString(16), ";");
|
||||
// Increase by 1 if we have a surrogate pair
|
||||
lastIdx = regExp.lastIndex += Number(cp !== char);
|
||||
}
|
||||
}
|
||||
return ret + str.substr(lastIdx);
|
||||
}
|
||||
//# sourceMappingURL=encode.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/encode.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/encode.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"encode.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":";;;;;;AAAA,8EAAkD;AAClD,yCAAwD;AAExD,IAAM,YAAY,GAAG,qCAAqC,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,SAAgB,UAAU,CAAC,IAAY;IACnC,OAAO,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC;AAFD,gCAEC;AACD;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,IAAY;IAC3C,OAAO,gBAAgB,CAAC,uBAAW,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAFD,gDAEC;AAED,SAAS,gBAAgB,CAAC,MAAc,EAAE,GAAW;IACjD,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,KAAK,C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,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAG,CAAC;YAChC,4CAA4C;YAC5C,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;SACrD;KACJ;IAED,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
||||
43
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/escape.d.ts
generated
vendored
Normal file
43
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/escape.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
export declare const xmlReplacer: RegExp;
|
||||
export declare const getCodePoint: (str: string, index: number) => number;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using XML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare function encodeXML(str: string): string;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using numeric hexadecimal reference (eg. `ü`).
|
||||
*
|
||||
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
||||
* of reduced transportability.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare const escape: typeof encodeXML;
|
||||
/**
|
||||
* Encodes all characters not valid in XML documents using XML entities.
|
||||
*
|
||||
* Note that the output will be character-set dependent.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare const escapeUTF8: (data: string) => string;
|
||||
/**
|
||||
* Encodes all characters that have to be escaped in HTML attributes,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare const escapeAttribute: (data: string) => string;
|
||||
/**
|
||||
* Encodes all characters that have to be escaped in HTML text,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare const escapeText: (data: string) => string;
|
||||
//# sourceMappingURL=escape.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/escape.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/escape.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"escape.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["escape.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAyB,CAAC;AAWlD,eAAO,MAAM,YAAY,QAGT,MAAM,SAAS,MAAM,KAAG,MAQD,CAAC;AAExC;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA0B7C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,kBAAY,CAAC;AAqChC;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,SA7Bb,MAAM,KAAK,MA6BuC,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SArClB,MAAM,KAAK,MA4CpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,SApDb,MAAM,KAAK,MA4DpB,CAAC"}
|
||||
122
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/escape.js
generated
vendored
Normal file
122
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/escape.js
generated
vendored
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.getCodePoint = exports.xmlReplacer = void 0;
|
||||
exports.xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
|
||||
var xmlCodeMap = new Map([
|
||||
[34, """],
|
||||
[38, "&"],
|
||||
[39, "'"],
|
||||
[60, "<"],
|
||||
[62, ">"],
|
||||
]);
|
||||
// For compatibility with node < 4, we wrap `codePointAt`
|
||||
exports.getCodePoint =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
String.prototype.codePointAt != null
|
||||
? function (str, index) { return str.codePointAt(index); }
|
||||
: // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||||
function (c, index) {
|
||||
return (c.charCodeAt(index) & 0xfc00) === 0xd800
|
||||
? (c.charCodeAt(index) - 0xd800) * 0x400 +
|
||||
c.charCodeAt(index + 1) -
|
||||
0xdc00 +
|
||||
0x10000
|
||||
: c.charCodeAt(index);
|
||||
};
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using XML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
function encodeXML(str) {
|
||||
var ret = "";
|
||||
var lastIdx = 0;
|
||||
var match;
|
||||
while ((match = exports.xmlReplacer.exec(str)) !== null) {
|
||||
var i = match.index;
|
||||
var char = str.charCodeAt(i);
|
||||
var next = xmlCodeMap.get(char);
|
||||
if (next !== undefined) {
|
||||
ret += str.substring(lastIdx, i) + next;
|
||||
lastIdx = i + 1;
|
||||
}
|
||||
else {
|
||||
ret += "".concat(str.substring(lastIdx, i), "&#x").concat((0, exports.getCodePoint)(str, i).toString(16), ";");
|
||||
// Increase by 1 if we have a surrogate pair
|
||||
lastIdx = exports.xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800);
|
||||
}
|
||||
}
|
||||
return ret + str.substr(lastIdx);
|
||||
}
|
||||
exports.encodeXML = encodeXML;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using numeric hexadecimal reference (eg. `ü`).
|
||||
*
|
||||
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
||||
* of reduced transportability.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
exports.escape = encodeXML;
|
||||
/**
|
||||
* Creates a function that escapes all characters matched by the given regular
|
||||
* expression using the given map of characters to escape to their entities.
|
||||
*
|
||||
* @param regex Regular expression to match characters to escape.
|
||||
* @param map Map of characters to escape to their entities.
|
||||
*
|
||||
* @returns Function that escapes all characters matched by the given regular
|
||||
* expression using the given map of characters to escape to their entities.
|
||||
*/
|
||||
function getEscaper(regex, map) {
|
||||
return function escape(data) {
|
||||
var match;
|
||||
var lastIdx = 0;
|
||||
var result = "";
|
||||
while ((match = regex.exec(data))) {
|
||||
if (lastIdx !== match.index) {
|
||||
result += data.substring(lastIdx, match.index);
|
||||
}
|
||||
// We know that this character will be in the map.
|
||||
result += map.get(match[0].charCodeAt(0));
|
||||
// Every match will be of length 1
|
||||
lastIdx = match.index + 1;
|
||||
}
|
||||
return result + data.substring(lastIdx);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Encodes all characters not valid in XML documents using XML entities.
|
||||
*
|
||||
* Note that the output will be character-set dependent.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
exports.escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap);
|
||||
/**
|
||||
* Encodes all characters that have to be escaped in HTML attributes,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
exports.escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([
|
||||
[34, """],
|
||||
[38, "&"],
|
||||
[160, " "],
|
||||
]));
|
||||
/**
|
||||
* Encodes all characters that have to be escaped in HTML text,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
exports.escapeText = getEscaper(/[&<>\u00A0]/g, new Map([
|
||||
[38, "&"],
|
||||
[60, "<"],
|
||||
[62, ">"],
|
||||
[160, " "],
|
||||
]));
|
||||
//# sourceMappingURL=escape.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/escape.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/escape.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"escape.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["escape.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,sBAAsB,CAAC;AAElD,IAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACvB,CAAC,EAAE,EAAE,QAAQ,CAAC;IACd,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,EAAE,EAAE,QAAQ,CAAC;IACd,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,yDAAyD;AAC5C,QAAA,YAAY;AACrB,uEAAuE;AACvE,MAAM,CAAC,SAAS,CAAC,WAAW,IAAI,IAAI;IAChC,CAAC,CAAC,UAAC,GAAW,EAAE,KAAa,IAAa,OAAA,GAAG,CAAC,WAAW,CAAC,KAAK,CAAE,EAAvB,CAAuB;IACjE,CAAC,CAAC,uEAAuE;QACvE,UAAC,CAAS,EAAE,KAAa;YACrB,OAAA,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,MAAM;gBACrC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,KAAK;oBACtC,CAAC,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC;oBACvB,MAAM;oBACN,OAAO;gBACT,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC;QALzB,CAKyB,CAAC;AAExC;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,GAAW;IACjC,IAAI,GAAG,GA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CAAC,EAAE;YAC/B,IAAI,OAAO,KAAK,KAAK,CAAC,KAAK,EAAE;gBACzB,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;aAClD;YAED,kDAAkD;YAClD,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAE,CAAC;YAE3C,kCAAkC;YAClC,OAAO,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;SAC7B;QAED,OAAO,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACU,QAAA,UAAU,GAAG,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAE7D;;;;;GAKG;AACU,QAAA,eAAe,GAAG,UAAU,CACrC,aAAa,EACb,IAAI,GAAG,CAAC;IACJ,CAAC,EAAE,EAAE,QAAQ,CAAC;IACd,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,GAAG,EAAE,QAAQ,CAAC;CAClB,CAAC,CACL,CAAC;AAEF;;;;;GAKG;AACU,QAAA,UAAU,GAAG,UAAU,CAChC,cAAc,EACd,IAAI,GAAG,CAAC;IACJ,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,QAAQ,CAAC;CAClB,CAAC,CACL,CAAC"}
|
||||
211
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode.d.ts
generated
vendored
Normal file
211
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
import htmlDecodeTree from "./generated/decode-data-html.js";
|
||||
import xmlDecodeTree from "./generated/decode-data-xml.js";
|
||||
import decodeCodePoint from "./decode_codepoint.js";
|
||||
export { htmlDecodeTree, xmlDecodeTree, decodeCodePoint };
|
||||
export { replaceCodePoint, fromCodePoint } from "./decode_codepoint.js";
|
||||
export declare enum BinTrieFlags {
|
||||
VALUE_LENGTH = 49152,
|
||||
BRANCH_LENGTH = 16256,
|
||||
JUMP_TABLE = 127
|
||||
}
|
||||
export declare enum DecodingMode {
|
||||
/** Entities in text nodes that can end with any character. */
|
||||
Legacy = 0,
|
||||
/** Only allow entities terminated with a semicolon. */
|
||||
Strict = 1,
|
||||
/** Entities in attributes have limitations on ending characters. */
|
||||
Attribute = 2
|
||||
}
|
||||
/**
|
||||
* Producers for character reference errors as defined in the HTML spec.
|
||||
*/
|
||||
export interface EntityErrorProducer {
|
||||
missingSemicolonAfterCharacterReference(): void;
|
||||
absenceOfDigitsInNumericCharacterReference(consumedCharacters: number): void;
|
||||
validateNumericCharacterReference(code: number): void;
|
||||
}
|
||||
/**
|
||||
* Token decoder with support of writing partial entities.
|
||||
*/
|
||||
export declare class EntityDecoder {
|
||||
/** The tree used to decode entities. */
|
||||
private readonly decodeTree;
|
||||
/**
|
||||
* The function that is called when a codepoint is decoded.
|
||||
*
|
||||
* For multi-byte named entities, this will be called multiple times,
|
||||
* with the second codepoint, and the same `consumed` value.
|
||||
*
|
||||
* @param codepoint The decoded codepoint.
|
||||
* @param consumed The number of bytes consumed by the decoder.
|
||||
*/
|
||||
private readonly emitCodePoint;
|
||||
/** An object that is used to produce errors. */
|
||||
private readonly errors?;
|
||||
constructor(
|
||||
/** The tree used to decode entities. */
|
||||
decodeTree: Uint16Array,
|
||||
/**
|
||||
* The function that is called when a codepoint is decoded.
|
||||
*
|
||||
* For multi-byte named entities, this will be called multiple times,
|
||||
* with the second codepoint, and the same `consumed` value.
|
||||
*
|
||||
* @param codepoint The decoded codepoint.
|
||||
* @param consumed The number of bytes consumed by the decoder.
|
||||
*/
|
||||
emitCodePoint: (cp: number, consumed: number) => void,
|
||||
/** An object that is used to produce errors. */
|
||||
errors?: EntityErrorProducer | undefined);
|
||||
/** The current state of the decoder. */
|
||||
private state;
|
||||
/** Characters that were consumed while parsing an entity. */
|
||||
private consumed;
|
||||
/**
|
||||
* The result of the entity.
|
||||
*
|
||||
* Either the result index of a numeric entity, or the codepoint of a
|
||||
* numeric entity.
|
||||
*/
|
||||
private result;
|
||||
/** The current index in the decode tree. */
|
||||
private treeIndex;
|
||||
/** The number of characters that were consumed in excess. */
|
||||
private excess;
|
||||
/** The mode in which the decoder is operating. */
|
||||
private decodeMode;
|
||||
/** Resets the instance to make it reusable. */
|
||||
startEntity(decodeMode: DecodingMode): void;
|
||||
/**
|
||||
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
||||
* If the entity is incomplete, the decoder will return -1.
|
||||
*
|
||||
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
|
||||
* entity is incomplete, and resume when the next string is written.
|
||||
*
|
||||
* @param string The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
write(str: string, offset: number): number;
|
||||
/**
|
||||
* Switches between the numeric decimal and hexadecimal states.
|
||||
*
|
||||
* Equivalent to the `Numeric character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
private stateNumericStart;
|
||||
private addToNumericResult;
|
||||
/**
|
||||
* Parses a hexadecimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Hexademical character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
private stateNumericHex;
|
||||
/**
|
||||
* Parses a decimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Decimal character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
private stateNumericDecimal;
|
||||
/**
|
||||
* Validate and emit a numeric entity.
|
||||
*
|
||||
* Implements the logic from the `Hexademical character reference start
|
||||
* state` and `Numeric character reference end state` in the HTML spec.
|
||||
*
|
||||
* @param lastCp The last code point of the entity. Used to see if the
|
||||
* entity was terminated with a semicolon.
|
||||
* @param expectedLength The minimum number of characters that should be
|
||||
* consumed. Used to validate that at least one digit
|
||||
* was consumed.
|
||||
* @returns The number of characters that were consumed.
|
||||
*/
|
||||
private emitNumericEntity;
|
||||
/**
|
||||
* Parses a named entity.
|
||||
*
|
||||
* Equivalent to the `Named character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
private stateNamedEntity;
|
||||
/**
|
||||
* Emit a named entity that was not terminated with a semicolon.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
private emitNotTerminatedNamedEntity;
|
||||
/**
|
||||
* Emit a named entity.
|
||||
*
|
||||
* @param result The index of the entity in the decode tree.
|
||||
* @param valueLength The number of bytes in the entity.
|
||||
* @param consumed The number of characters consumed.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
private emitNamedEntityData;
|
||||
/**
|
||||
* Signal to the parser that the end of the input was reached.
|
||||
*
|
||||
* Remaining data will be emitted and relevant errors will be produced.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
end(): number;
|
||||
}
|
||||
/**
|
||||
* Determines the branch of the current node that is taken given the current
|
||||
* character. This function is used to traverse the trie.
|
||||
*
|
||||
* @param decodeTree The trie.
|
||||
* @param current The current node.
|
||||
* @param nodeIdx The index right after the current node and its value.
|
||||
* @param char The current character.
|
||||
* @returns The index of the next node, or -1 if no branch is taken.
|
||||
*/
|
||||
export declare function determineBranch(decodeTree: Uint16Array, current: number, nodeIdx: number, char: number): number;
|
||||
/**
|
||||
* Decodes an HTML string.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @param mode The decoding mode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export declare function decodeHTML(str: string, mode?: DecodingMode): string;
|
||||
/**
|
||||
* Decodes an HTML string in an attribute.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export declare function decodeHTMLAttribute(str: string): string;
|
||||
/**
|
||||
* Decodes an HTML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export declare function decodeHTMLStrict(str: string): string;
|
||||
/**
|
||||
* Decodes an XML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export declare function decodeXML(str: string): string;
|
||||
//# sourceMappingURL=decode.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iCAAiC,CAAC;AAC7D,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,eAGN,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,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;IA8B1C;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,kBAAkB;IAe1B;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAkBvB;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAkB3B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,iBAAiB;IA6BzB;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAsDxB;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAYpC;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;;;;;OAMG;IACH,GAAG,IAAI,MAAM;CA6BhB;AAoDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,WAAW,EACvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACb,MAAM,CAsCR;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,eAAsB,GAAG,MAAM,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
||||
496
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode.js
generated
vendored
Normal file
496
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode.js
generated
vendored
Normal file
|
|
@ -0,0 +1,496 @@
|
|||
import htmlDecodeTree from "./generated/decode-data-html.js";
|
||||
import xmlDecodeTree from "./generated/decode-data-xml.js";
|
||||
import decodeCodePoint, { replaceCodePoint, fromCodePoint, } from "./decode_codepoint.js";
|
||||
// Re-export for use by eg. htmlparser2
|
||||
export { htmlDecodeTree, xmlDecodeTree, decodeCodePoint };
|
||||
export { replaceCodePoint, fromCodePoint } from "./decode_codepoint.js";
|
||||
var CharCodes;
|
||||
(function (CharCodes) {
|
||||
CharCodes[CharCodes["NUM"] = 35] = "NUM";
|
||||
CharCodes[CharCodes["SEMI"] = 59] = "SEMI";
|
||||
CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS";
|
||||
CharCodes[CharCodes["ZERO"] = 48] = "ZERO";
|
||||
CharCodes[CharCodes["NINE"] = 57] = "NINE";
|
||||
CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A";
|
||||
CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F";
|
||||
CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X";
|
||||
CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z";
|
||||
CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A";
|
||||
CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F";
|
||||
CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z";
|
||||
})(CharCodes || (CharCodes = {}));
|
||||
/** Bit that needs to be set to convert an upper case ASCII character to lower case */
|
||||
const TO_LOWER_BIT = 0b100000;
|
||||
export var BinTrieFlags;
|
||||
(function (BinTrieFlags) {
|
||||
BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
|
||||
BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH";
|
||||
BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
|
||||
})(BinTrieFlags || (BinTrieFlags = {}));
|
||||
function isNumber(code) {
|
||||
return code >= CharCodes.ZERO && code <= CharCodes.NINE;
|
||||
}
|
||||
function isHexadecimalCharacter(code) {
|
||||
return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||
|
||||
(code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F));
|
||||
}
|
||||
function isAsciiAlphaNumeric(code) {
|
||||
return ((code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||
|
||||
(code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||
|
||||
isNumber(code));
|
||||
}
|
||||
/**
|
||||
* Checks if the given character is a valid end character for an entity in an attribute.
|
||||
*
|
||||
* Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.
|
||||
* See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
|
||||
*/
|
||||
function isEntityInAttributeInvalidEnd(code) {
|
||||
return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
|
||||
}
|
||||
var EntityDecoderState;
|
||||
(function (EntityDecoderState) {
|
||||
EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart";
|
||||
EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart";
|
||||
EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal";
|
||||
EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex";
|
||||
EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity";
|
||||
})(EntityDecoderState || (EntityDecoderState = {}));
|
||||
export var DecodingMode;
|
||||
(function (DecodingMode) {
|
||||
/** Entities in text nodes that can end with any character. */
|
||||
DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
|
||||
/** Only allow entities terminated with a semicolon. */
|
||||
DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
|
||||
/** Entities in attributes have limitations on ending characters. */
|
||||
DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
|
||||
})(DecodingMode || (DecodingMode = {}));
|
||||
/**
|
||||
* Token decoder with support of writing partial entities.
|
||||
*/
|
||||
export class EntityDecoder {
|
||||
constructor(
|
||||
/** The tree used to decode entities. */
|
||||
decodeTree,
|
||||
/**
|
||||
* The function that is called when a codepoint is decoded.
|
||||
*
|
||||
* For multi-byte named entities, this will be called multiple times,
|
||||
* with the second codepoint, and the same `consumed` value.
|
||||
*
|
||||
* @param codepoint The decoded codepoint.
|
||||
* @param consumed The number of bytes consumed by the decoder.
|
||||
*/
|
||||
emitCodePoint,
|
||||
/** An object that is used to produce errors. */
|
||||
errors) {
|
||||
this.decodeTree = decodeTree;
|
||||
this.emitCodePoint = emitCodePoint;
|
||||
this.errors = errors;
|
||||
/** The current state of the decoder. */
|
||||
this.state = EntityDecoderState.EntityStart;
|
||||
/** Characters that were consumed while parsing an entity. */
|
||||
this.consumed = 1;
|
||||
/**
|
||||
* The result of the entity.
|
||||
*
|
||||
* Either the result index of a numeric entity, or the codepoint of a
|
||||
* numeric entity.
|
||||
*/
|
||||
this.result = 0;
|
||||
/** The current index in the decode tree. */
|
||||
this.treeIndex = 0;
|
||||
/** The number of characters that were consumed in excess. */
|
||||
this.excess = 1;
|
||||
/** The mode in which the decoder is operating. */
|
||||
this.decodeMode = DecodingMode.Strict;
|
||||
}
|
||||
/** Resets the instance to make it reusable. */
|
||||
startEntity(decodeMode) {
|
||||
this.decodeMode = decodeMode;
|
||||
this.state = EntityDecoderState.EntityStart;
|
||||
this.result = 0;
|
||||
this.treeIndex = 0;
|
||||
this.excess = 1;
|
||||
this.consumed = 1;
|
||||
}
|
||||
/**
|
||||
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
||||
* If the entity is incomplete, the decoder will return -1.
|
||||
*
|
||||
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
|
||||
* entity is incomplete, and resume when the next string is written.
|
||||
*
|
||||
* @param string The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
write(str, offset) {
|
||||
switch (this.state) {
|
||||
case EntityDecoderState.EntityStart: {
|
||||
if (str.charCodeAt(offset) === CharCodes.NUM) {
|
||||
this.state = EntityDecoderState.NumericStart;
|
||||
this.consumed += 1;
|
||||
return this.stateNumericStart(str, offset + 1);
|
||||
}
|
||||
this.state = EntityDecoderState.NamedEntity;
|
||||
return this.stateNamedEntity(str, offset);
|
||||
}
|
||||
case EntityDecoderState.NumericStart: {
|
||||
return this.stateNumericStart(str, offset);
|
||||
}
|
||||
case EntityDecoderState.NumericDecimal: {
|
||||
return this.stateNumericDecimal(str, offset);
|
||||
}
|
||||
case EntityDecoderState.NumericHex: {
|
||||
return this.stateNumericHex(str, offset);
|
||||
}
|
||||
case EntityDecoderState.NamedEntity: {
|
||||
return this.stateNamedEntity(str, offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Switches between the numeric decimal and hexadecimal states.
|
||||
*
|
||||
* Equivalent to the `Numeric character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
stateNumericStart(str, offset) {
|
||||
if (offset >= str.length) {
|
||||
return -1;
|
||||
}
|
||||
if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
|
||||
this.state = EntityDecoderState.NumericHex;
|
||||
this.consumed += 1;
|
||||
return this.stateNumericHex(str, offset + 1);
|
||||
}
|
||||
this.state = EntityDecoderState.NumericDecimal;
|
||||
return this.stateNumericDecimal(str, offset);
|
||||
}
|
||||
addToNumericResult(str, start, end, base) {
|
||||
if (start !== end) {
|
||||
const digitCount = end - start;
|
||||
this.result =
|
||||
this.result * Math.pow(base, digitCount) +
|
||||
parseInt(str.substr(start, digitCount), base);
|
||||
this.consumed += digitCount;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Parses a hexadecimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Hexademical character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
stateNumericHex(str, offset) {
|
||||
const startIdx = offset;
|
||||
while (offset < str.length) {
|
||||
const char = str.charCodeAt(offset);
|
||||
if (isNumber(char) || isHexadecimalCharacter(char)) {
|
||||
offset += 1;
|
||||
}
|
||||
else {
|
||||
this.addToNumericResult(str, startIdx, offset, 16);
|
||||
return this.emitNumericEntity(char, 3);
|
||||
}
|
||||
}
|
||||
this.addToNumericResult(str, startIdx, offset, 16);
|
||||
return -1;
|
||||
}
|
||||
/**
|
||||
* Parses a decimal numeric entity.
|
||||
*
|
||||
* Equivalent to the `Decimal character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
stateNumericDecimal(str, offset) {
|
||||
const startIdx = offset;
|
||||
while (offset < str.length) {
|
||||
const char = str.charCodeAt(offset);
|
||||
if (isNumber(char)) {
|
||||
offset += 1;
|
||||
}
|
||||
else {
|
||||
this.addToNumericResult(str, startIdx, offset, 10);
|
||||
return this.emitNumericEntity(char, 2);
|
||||
}
|
||||
}
|
||||
this.addToNumericResult(str, startIdx, offset, 10);
|
||||
return -1;
|
||||
}
|
||||
/**
|
||||
* Validate and emit a numeric entity.
|
||||
*
|
||||
* Implements the logic from the `Hexademical character reference start
|
||||
* state` and `Numeric character reference end state` in the HTML spec.
|
||||
*
|
||||
* @param lastCp The last code point of the entity. Used to see if the
|
||||
* entity was terminated with a semicolon.
|
||||
* @param expectedLength The minimum number of characters that should be
|
||||
* consumed. Used to validate that at least one digit
|
||||
* was consumed.
|
||||
* @returns The number of characters that were consumed.
|
||||
*/
|
||||
emitNumericEntity(lastCp, expectedLength) {
|
||||
var _a;
|
||||
// Ensure we consumed at least one digit.
|
||||
if (this.consumed <= expectedLength) {
|
||||
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
||||
return 0;
|
||||
}
|
||||
// Figure out if this is a legit end of the entity
|
||||
if (lastCp === CharCodes.SEMI) {
|
||||
this.consumed += 1;
|
||||
}
|
||||
else if (this.decodeMode === DecodingMode.Strict) {
|
||||
return 0;
|
||||
}
|
||||
this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
|
||||
if (this.errors) {
|
||||
if (lastCp !== CharCodes.SEMI) {
|
||||
this.errors.missingSemicolonAfterCharacterReference();
|
||||
}
|
||||
this.errors.validateNumericCharacterReference(this.result);
|
||||
}
|
||||
return this.consumed;
|
||||
}
|
||||
/**
|
||||
* Parses a named entity.
|
||||
*
|
||||
* Equivalent to the `Named character reference state` in the HTML spec.
|
||||
*
|
||||
* @param str The string containing the entity (or a continuation of the entity).
|
||||
* @param offset The current offset.
|
||||
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
||||
*/
|
||||
stateNamedEntity(str, offset) {
|
||||
const { decodeTree } = this;
|
||||
let current = decodeTree[this.treeIndex];
|
||||
// The mask is the number of bytes of the value, including the current byte.
|
||||
let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
for (; offset < str.length; offset++, this.excess++) {
|
||||
const char = str.charCodeAt(offset);
|
||||
this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
|
||||
if (this.treeIndex < 0) {
|
||||
return this.result === 0 ||
|
||||
// If we are parsing an attribute
|
||||
(this.decodeMode === DecodingMode.Attribute &&
|
||||
// We shouldn't have consumed any characters after the entity,
|
||||
(valueLength === 0 ||
|
||||
// And there should be no invalid characters.
|
||||
isEntityInAttributeInvalidEnd(char)))
|
||||
? 0
|
||||
: this.emitNotTerminatedNamedEntity();
|
||||
}
|
||||
current = decodeTree[this.treeIndex];
|
||||
valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
// If the branch is a value, store it and continue
|
||||
if (valueLength !== 0) {
|
||||
// If the entity is terminated by a semicolon, we are done.
|
||||
if (char === CharCodes.SEMI) {
|
||||
return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
|
||||
}
|
||||
// If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.
|
||||
if (this.decodeMode !== DecodingMode.Strict) {
|
||||
this.result = this.treeIndex;
|
||||
this.consumed += this.excess;
|
||||
this.excess = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
/**
|
||||
* Emit a named entity that was not terminated with a semicolon.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
emitNotTerminatedNamedEntity() {
|
||||
var _a;
|
||||
const { result, decodeTree } = this;
|
||||
const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
|
||||
this.emitNamedEntityData(result, valueLength, this.consumed);
|
||||
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();
|
||||
return this.consumed;
|
||||
}
|
||||
/**
|
||||
* Emit a named entity.
|
||||
*
|
||||
* @param result The index of the entity in the decode tree.
|
||||
* @param valueLength The number of bytes in the entity.
|
||||
* @param consumed The number of characters consumed.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
emitNamedEntityData(result, valueLength, consumed) {
|
||||
const { decodeTree } = this;
|
||||
this.emitCodePoint(valueLength === 1
|
||||
? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH
|
||||
: decodeTree[result + 1], consumed);
|
||||
if (valueLength === 3) {
|
||||
// For multi-byte values, we need to emit the second byte.
|
||||
this.emitCodePoint(decodeTree[result + 2], consumed);
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
/**
|
||||
* Signal to the parser that the end of the input was reached.
|
||||
*
|
||||
* Remaining data will be emitted and relevant errors will be produced.
|
||||
*
|
||||
* @returns The number of characters consumed.
|
||||
*/
|
||||
end() {
|
||||
var _a;
|
||||
switch (this.state) {
|
||||
case EntityDecoderState.NamedEntity: {
|
||||
// Emit a named entity if we have one.
|
||||
return this.result !== 0 &&
|
||||
(this.decodeMode !== DecodingMode.Attribute ||
|
||||
this.result === this.treeIndex)
|
||||
? this.emitNotTerminatedNamedEntity()
|
||||
: 0;
|
||||
}
|
||||
// Otherwise, emit a numeric entity if we have one.
|
||||
case EntityDecoderState.NumericDecimal: {
|
||||
return this.emitNumericEntity(0, 2);
|
||||
}
|
||||
case EntityDecoderState.NumericHex: {
|
||||
return this.emitNumericEntity(0, 3);
|
||||
}
|
||||
case EntityDecoderState.NumericStart: {
|
||||
(_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);
|
||||
return 0;
|
||||
}
|
||||
case EntityDecoderState.EntityStart: {
|
||||
// Return 0 if we have no entity.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates a function that decodes entities in a string.
|
||||
*
|
||||
* @param decodeTree The decode tree.
|
||||
* @returns A function that decodes entities in a string.
|
||||
*/
|
||||
function getDecoder(decodeTree) {
|
||||
let ret = "";
|
||||
const decoder = new EntityDecoder(decodeTree, (str) => (ret += fromCodePoint(str)));
|
||||
return function decodeWithTrie(str, decodeMode) {
|
||||
let lastIndex = 0;
|
||||
let offset = 0;
|
||||
while ((offset = str.indexOf("&", offset)) >= 0) {
|
||||
ret += str.slice(lastIndex, offset);
|
||||
decoder.startEntity(decodeMode);
|
||||
const len = decoder.write(str,
|
||||
// Skip the "&"
|
||||
offset + 1);
|
||||
if (len < 0) {
|
||||
lastIndex = offset + decoder.end();
|
||||
break;
|
||||
}
|
||||
lastIndex = offset + len;
|
||||
// If `len` is 0, skip the current `&` and continue.
|
||||
offset = len === 0 ? lastIndex + 1 : lastIndex;
|
||||
}
|
||||
const result = ret + str.slice(lastIndex);
|
||||
// Make sure we don't keep a reference to the final string.
|
||||
ret = "";
|
||||
return result;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Determines the branch of the current node that is taken given the current
|
||||
* character. This function is used to traverse the trie.
|
||||
*
|
||||
* @param decodeTree The trie.
|
||||
* @param current The current node.
|
||||
* @param nodeIdx The index right after the current node and its value.
|
||||
* @param char The current character.
|
||||
* @returns The index of the next node, or -1 if no branch is taken.
|
||||
*/
|
||||
export function determineBranch(decodeTree, current, nodeIdx, char) {
|
||||
const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
|
||||
const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
|
||||
// Case 1: Single branch encoded in jump offset
|
||||
if (branchCount === 0) {
|
||||
return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;
|
||||
}
|
||||
// Case 2: Multiple branches encoded in jump table
|
||||
if (jumpOffset) {
|
||||
const value = char - jumpOffset;
|
||||
return value < 0 || value >= branchCount
|
||||
? -1
|
||||
: decodeTree[nodeIdx + value] - 1;
|
||||
}
|
||||
// Case 3: Multiple branches encoded in dictionary
|
||||
// Binary search for the character.
|
||||
let lo = nodeIdx;
|
||||
let hi = lo + branchCount - 1;
|
||||
while (lo <= hi) {
|
||||
const mid = (lo + hi) >>> 1;
|
||||
const midVal = decodeTree[mid];
|
||||
if (midVal < char) {
|
||||
lo = mid + 1;
|
||||
}
|
||||
else if (midVal > char) {
|
||||
hi = mid - 1;
|
||||
}
|
||||
else {
|
||||
return decodeTree[mid + branchCount];
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
const htmlDecoder = getDecoder(htmlDecodeTree);
|
||||
const xmlDecoder = getDecoder(xmlDecodeTree);
|
||||
/**
|
||||
* Decodes an HTML string.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @param mode The decoding mode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export function decodeHTML(str, mode = DecodingMode.Legacy) {
|
||||
return htmlDecoder(str, mode);
|
||||
}
|
||||
/**
|
||||
* Decodes an HTML string in an attribute.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export function decodeHTMLAttribute(str) {
|
||||
return htmlDecoder(str, DecodingMode.Attribute);
|
||||
}
|
||||
/**
|
||||
* Decodes an HTML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export function decodeHTMLStrict(str) {
|
||||
return htmlDecoder(str, DecodingMode.Strict);
|
||||
}
|
||||
/**
|
||||
* Decodes an XML string, requiring all entities to be terminated by a semicolon.
|
||||
*
|
||||
* @param str The string to decode.
|
||||
* @returns The decoded string.
|
||||
*/
|
||||
export function decodeXML(str) {
|
||||
return xmlDecoder(str, DecodingMode.Strict);
|
||||
}
|
||||
//# sourceMappingURL=decode.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode_codepoint.d.ts
generated
vendored
Normal file
19
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode_codepoint.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
|
||||
*/
|
||||
export declare const fromCodePoint: (...codePoints: number[]) => string;
|
||||
/**
|
||||
* Replace the given code point with a replacement character if it is a
|
||||
* surrogate or is outside the valid range. Otherwise return the code
|
||||
* point unchanged.
|
||||
*/
|
||||
export declare function replaceCodePoint(codePoint: number): number;
|
||||
/**
|
||||
* Replace the code point if relevant, then convert it to a string.
|
||||
*
|
||||
* @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
|
||||
* @param codePoint The code point to decode.
|
||||
* @returns The decoded code point.
|
||||
*/
|
||||
export default function decodeCodePoint(codePoint: number): string;
|
||||
//# sourceMappingURL=decode_codepoint.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode_codepoint.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode_codepoint.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode_codepoint.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_codepoint.ts"],"names":[],"mappings":"AAkCA;;GAEG;AACH,eAAO,MAAM,aAAa,qCAgBrB,CAAC;AAEN;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,UAMjD;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE"}
|
||||
71
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode_codepoint.js
generated
vendored
Normal file
71
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode_codepoint.js
generated
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134
|
||||
var _a;
|
||||
const decodeMap = new Map([
|
||||
[0, 65533],
|
||||
// C1 Unicode control character reference replacements
|
||||
[128, 8364],
|
||||
[130, 8218],
|
||||
[131, 402],
|
||||
[132, 8222],
|
||||
[133, 8230],
|
||||
[134, 8224],
|
||||
[135, 8225],
|
||||
[136, 710],
|
||||
[137, 8240],
|
||||
[138, 352],
|
||||
[139, 8249],
|
||||
[140, 338],
|
||||
[142, 381],
|
||||
[145, 8216],
|
||||
[146, 8217],
|
||||
[147, 8220],
|
||||
[148, 8221],
|
||||
[149, 8226],
|
||||
[150, 8211],
|
||||
[151, 8212],
|
||||
[152, 732],
|
||||
[153, 8482],
|
||||
[154, 353],
|
||||
[155, 8250],
|
||||
[156, 339],
|
||||
[158, 382],
|
||||
[159, 376],
|
||||
]);
|
||||
/**
|
||||
* Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.
|
||||
*/
|
||||
export const fromCodePoint =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
||||
(_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) {
|
||||
let output = "";
|
||||
if (codePoint > 0xffff) {
|
||||
codePoint -= 0x10000;
|
||||
output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);
|
||||
codePoint = 0xdc00 | (codePoint & 0x3ff);
|
||||
}
|
||||
output += String.fromCharCode(codePoint);
|
||||
return output;
|
||||
};
|
||||
/**
|
||||
* Replace the given code point with a replacement character if it is a
|
||||
* surrogate or is outside the valid range. Otherwise return the code
|
||||
* point unchanged.
|
||||
*/
|
||||
export function replaceCodePoint(codePoint) {
|
||||
var _a;
|
||||
if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
|
||||
return 0xfffd;
|
||||
}
|
||||
return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;
|
||||
}
|
||||
/**
|
||||
* Replace the code point if relevant, then convert it to a string.
|
||||
*
|
||||
* @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead.
|
||||
* @param codePoint The code point to decode.
|
||||
* @returns The decoded code point.
|
||||
*/
|
||||
export default function decodeCodePoint(codePoint) {
|
||||
return fromCodePoint(replaceCodePoint(codePoint));
|
||||
}
|
||||
//# sourceMappingURL=decode_codepoint.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode_codepoint.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/decode_codepoint.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode_codepoint.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["decode_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C;IAEhB,IAAI,SAAS,GAAG,MAAM,EAAE;QACpB,SAAS,IAAI,OAAO,CAAC;QACrB,MAAM,IAAI,MAAM,CAAC,YAAY,CACzB,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CACxC,CAAC;QACF,SAAS,GAAG,MAAM,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;KAC5C;IAED,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAEN;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;;IAC9C,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,SAAS,GAAG,QAAQ,EAAE;QACtE,OAAO,MAAM,CAAC;KACjB;IAED,OAAO,MAAA,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,mCAAI,SAAS,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAiB;IACrD,OAAO,aAAa,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD,CAAC"}
|
||||
22
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/encode.d.ts
generated
vendored
Normal file
22
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/encode.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Encodes all characters in the input using HTML entities. This includes
|
||||
* characters that are valid ASCII characters in HTML documents, such as `#`.
|
||||
*
|
||||
* To get a more compact output, consider using the `encodeNonAsciiHTML`
|
||||
* function, which will only encode characters that are not valid in HTML
|
||||
* documents, as well as non-ASCII characters.
|
||||
*
|
||||
* If a character has no equivalent entity, a numeric hexadecimal reference
|
||||
* (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare function encodeHTML(data: string): string;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
||||
* documents using HTML entities. This function will not encode characters that
|
||||
* are valid in HTML documents, such as `#`.
|
||||
*
|
||||
* If a character has no equivalent entity, a numeric hexadecimal reference
|
||||
* (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare function encodeNonAsciiHTML(data: string): string;
|
||||
//# sourceMappingURL=encode.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/encode.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/encode.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"encode.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AACD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvD"}
|
||||
69
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/encode.js
generated
vendored
Normal file
69
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/encode.js
generated
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
import htmlTrie from "./generated/encode-html.js";
|
||||
import { xmlReplacer, getCodePoint } from "./escape.js";
|
||||
const htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;
|
||||
/**
|
||||
* Encodes all characters in the input using HTML entities. This includes
|
||||
* characters that are valid ASCII characters in HTML documents, such as `#`.
|
||||
*
|
||||
* To get a more compact output, consider using the `encodeNonAsciiHTML`
|
||||
* function, which will only encode characters that are not valid in HTML
|
||||
* documents, as well as non-ASCII characters.
|
||||
*
|
||||
* If a character has no equivalent entity, a numeric hexadecimal reference
|
||||
* (eg. `ü`) will be used.
|
||||
*/
|
||||
export function encodeHTML(data) {
|
||||
return encodeHTMLTrieRe(htmlReplacer, data);
|
||||
}
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
||||
* documents using HTML entities. This function will not encode characters that
|
||||
* are valid in HTML documents, such as `#`.
|
||||
*
|
||||
* If a character has no equivalent entity, a numeric hexadecimal reference
|
||||
* (eg. `ü`) will be used.
|
||||
*/
|
||||
export function encodeNonAsciiHTML(data) {
|
||||
return encodeHTMLTrieRe(xmlReplacer, data);
|
||||
}
|
||||
function encodeHTMLTrieRe(regExp, str) {
|
||||
let ret = "";
|
||||
let lastIdx = 0;
|
||||
let match;
|
||||
while ((match = regExp.exec(str)) !== null) {
|
||||
const i = match.index;
|
||||
ret += str.substring(lastIdx, i);
|
||||
const char = str.charCodeAt(i);
|
||||
let next = htmlTrie.get(char);
|
||||
if (typeof next === "object") {
|
||||
// We are in a branch. Try to match the next char.
|
||||
if (i + 1 < str.length) {
|
||||
const nextChar = str.charCodeAt(i + 1);
|
||||
const value = typeof next.n === "number"
|
||||
? next.n === nextChar
|
||||
? next.o
|
||||
: undefined
|
||||
: next.n.get(nextChar);
|
||||
if (value !== undefined) {
|
||||
ret += value;
|
||||
lastIdx = regExp.lastIndex += 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
next = next.v;
|
||||
}
|
||||
// We might have a tree node without a value; skip and use a numeric entity.
|
||||
if (next !== undefined) {
|
||||
ret += next;
|
||||
lastIdx = i + 1;
|
||||
}
|
||||
else {
|
||||
const cp = getCodePoint(str, i);
|
||||
ret += `&#x${cp.toString(16)};`;
|
||||
// Increase by 1 if we have a surrogate pair
|
||||
lastIdx = regExp.lastIndex += Number(cp !== char);
|
||||
}
|
||||
}
|
||||
return ret + str.substr(lastIdx);
|
||||
}
|
||||
//# sourceMappingURL=encode.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/encode.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/encode.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"encode.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["encode.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,YAAY,GAAG,qCAAqC,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACnC,OAAO,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAChD,CAAC;AACD;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC3C,OAAO,gBAAgB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc,EAAE,GAAW;IACjD,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,KAAK,CAAC;IAEV,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;QACxC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;QACtB,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACjC,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC/B,IAAI,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAE9B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC1B,kDAAkD;YAClD,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;gBACpB,MAAM,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACvC,MAAM,KAAK,GACP,OAAO,IAAI,CAAC,CAAC,KAAK,QAAQ;oBACtB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,QAAQ;wBACjB,CAAC,CAAC,IAAI,CAAC,CAAC;wBACR,CAAC,CAAC,SAAS;oBACf,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBAE/B,IAAI,KAAK,KAAK,SAAS,EAAE;oBACrB,GAAG,IAAI,KAAK,CAAC;oBACb,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC;oBAChC,SAAS;iBACZ;aACJ;YAED,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;SACjB;QAED,4EAA4E;QAC5E,IAAI,IAAI,KAAK,SAAS,EAAE;YACpB,GAAG,IAAI,IAAI,CAAC;YACZ,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;SACnB;aAAM;YACH,MAAM,EAAE,GAAG,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAChC,GAAG,IAAI,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;YAChC,4CAA4C;YAC5C,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC;SACrD;KACJ;IAED,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
||||
43
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/escape.d.ts
generated
vendored
Normal file
43
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/escape.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
export declare const xmlReplacer: RegExp;
|
||||
export declare const getCodePoint: (str: string, index: number) => number;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using XML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
export declare function encodeXML(str: string): string;
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using numeric hexadecimal reference (eg. `ü`).
|
||||
*
|
||||
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
||||
* of reduced transportability.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare const escape: typeof encodeXML;
|
||||
/**
|
||||
* Encodes all characters not valid in XML documents using XML entities.
|
||||
*
|
||||
* Note that the output will be character-set dependent.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare const escapeUTF8: (data: string) => string;
|
||||
/**
|
||||
* Encodes all characters that have to be escaped in HTML attributes,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare const escapeAttribute: (data: string) => string;
|
||||
/**
|
||||
* Encodes all characters that have to be escaped in HTML text,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export declare const escapeText: (data: string) => string;
|
||||
//# sourceMappingURL=escape.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/escape.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/escape.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"escape.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["escape.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAyB,CAAC;AAWlD,eAAO,MAAM,YAAY,QAGT,MAAM,SAAS,MAAM,KAAG,MAQD,CAAC;AAExC;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA0B7C;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,kBAAY,CAAC;AAqChC;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,SA7Bb,MAAM,KAAK,MA6BuC,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SArClB,MAAM,KAAK,MA4CpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,SApDb,MAAM,KAAK,MA4DpB,CAAC"}
|
||||
116
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/escape.js
generated
vendored
Normal file
116
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/escape.js
generated
vendored
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
export const xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
|
||||
const xmlCodeMap = new Map([
|
||||
[34, """],
|
||||
[38, "&"],
|
||||
[39, "'"],
|
||||
[60, "<"],
|
||||
[62, ">"],
|
||||
]);
|
||||
// For compatibility with node < 4, we wrap `codePointAt`
|
||||
export const getCodePoint =
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
String.prototype.codePointAt != null
|
||||
? (str, index) => str.codePointAt(index)
|
||||
: // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||||
(c, index) => (c.charCodeAt(index) & 0xfc00) === 0xd800
|
||||
? (c.charCodeAt(index) - 0xd800) * 0x400 +
|
||||
c.charCodeAt(index + 1) -
|
||||
0xdc00 +
|
||||
0x10000
|
||||
: c.charCodeAt(index);
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using XML entities.
|
||||
*
|
||||
* If a character has no equivalent entity, a
|
||||
* numeric hexadecimal reference (eg. `ü`) will be used.
|
||||
*/
|
||||
export function encodeXML(str) {
|
||||
let ret = "";
|
||||
let lastIdx = 0;
|
||||
let match;
|
||||
while ((match = xmlReplacer.exec(str)) !== null) {
|
||||
const i = match.index;
|
||||
const char = str.charCodeAt(i);
|
||||
const next = xmlCodeMap.get(char);
|
||||
if (next !== undefined) {
|
||||
ret += str.substring(lastIdx, i) + next;
|
||||
lastIdx = i + 1;
|
||||
}
|
||||
else {
|
||||
ret += `${str.substring(lastIdx, i)}&#x${getCodePoint(str, i).toString(16)};`;
|
||||
// Increase by 1 if we have a surrogate pair
|
||||
lastIdx = xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800);
|
||||
}
|
||||
}
|
||||
return ret + str.substr(lastIdx);
|
||||
}
|
||||
/**
|
||||
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
||||
* documents using numeric hexadecimal reference (eg. `ü`).
|
||||
*
|
||||
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
||||
* of reduced transportability.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export const escape = encodeXML;
|
||||
/**
|
||||
* Creates a function that escapes all characters matched by the given regular
|
||||
* expression using the given map of characters to escape to their entities.
|
||||
*
|
||||
* @param regex Regular expression to match characters to escape.
|
||||
* @param map Map of characters to escape to their entities.
|
||||
*
|
||||
* @returns Function that escapes all characters matched by the given regular
|
||||
* expression using the given map of characters to escape to their entities.
|
||||
*/
|
||||
function getEscaper(regex, map) {
|
||||
return function escape(data) {
|
||||
let match;
|
||||
let lastIdx = 0;
|
||||
let result = "";
|
||||
while ((match = regex.exec(data))) {
|
||||
if (lastIdx !== match.index) {
|
||||
result += data.substring(lastIdx, match.index);
|
||||
}
|
||||
// We know that this character will be in the map.
|
||||
result += map.get(match[0].charCodeAt(0));
|
||||
// Every match will be of length 1
|
||||
lastIdx = match.index + 1;
|
||||
}
|
||||
return result + data.substring(lastIdx);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Encodes all characters not valid in XML documents using XML entities.
|
||||
*
|
||||
* Note that the output will be character-set dependent.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export const escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap);
|
||||
/**
|
||||
* Encodes all characters that have to be escaped in HTML attributes,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export const escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([
|
||||
[34, """],
|
||||
[38, "&"],
|
||||
[160, " "],
|
||||
]));
|
||||
/**
|
||||
* Encodes all characters that have to be escaped in HTML text,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*
|
||||
* @param data String to escape.
|
||||
*/
|
||||
export const escapeText = getEscaper(/[&<>\u00A0]/g, new Map([
|
||||
[38, "&"],
|
||||
[60, "<"],
|
||||
[62, ">"],
|
||||
[160, " "],
|
||||
]));
|
||||
//# sourceMappingURL=escape.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/escape.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/escape.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"escape.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["escape.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAElD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACvB,CAAC,EAAE,EAAE,QAAQ,CAAC;IACd,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,EAAE,EAAE,QAAQ,CAAC;IACd,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,yDAAyD;AACzD,MAAM,CAAC,MAAM,YAAY;AACrB,uEAAuE;AACvE,MAAM,CAAC,SAAS,CAAC,WAAW,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EAAE,OAAO,CAAC;IACb,CAAC,GAAG,EAAE,QAAQ,CAAC;CAClB,CAAC,CACL,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAChC,cAAc,EACd,IAAI,GAAG,CAAC;IACJ,CAAC,EAAE,EAAE,OAAO,CAAC;IACb,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,QAAQ,CAAC;CAClB,CAAC,CACL,CAAC"}
|
||||
3
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-html.d.ts
generated
vendored
Normal file
3
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-html.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
declare const _default: Uint16Array;
|
||||
export default _default;
|
||||
//# sourceMappingURL=decode-data-html.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode-data-html.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-html.ts"],"names":[],"mappings":";AAEA,wBAKE"}
|
||||
7
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-html.js
generated
vendored
Normal file
7
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-html.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-html.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-html.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode-data-html.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-html.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,eAAe,IAAI,WAAW;AAC1B,kBAAkB;AAClB,268CAA268C;KACt68C,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACnC,CAAC"}
|
||||
3
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts
generated
vendored
Normal file
3
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
declare const _default: Uint16Array;
|
||||
export default _default;
|
||||
//# sourceMappingURL=decode-data-xml.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode-data-xml.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-xml.ts"],"names":[],"mappings":";AAEA,wBAKE"}
|
||||
7
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-xml.js
generated
vendored
Normal file
7
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-xml.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// Generated using scripts/write-decode-map.ts
|
||||
export default new Uint16Array(
|
||||
// prettier-ignore
|
||||
"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022"
|
||||
.split("")
|
||||
.map((c) => c.charCodeAt(0)));
|
||||
//# sourceMappingURL=decode-data-xml.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-xml.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/decode-data-xml.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode-data-xml.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-xml.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C,eAAe,IAAI,WAAW;AAC1B,kBAAkB;AAClB,uFAAuF;KAClF,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACnC,CAAC"}
|
||||
8
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/encode-html.d.ts
generated
vendored
Normal file
8
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/encode-html.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
type EncodeTrieNode = string | {
|
||||
v?: string;
|
||||
n: number | Map<number, EncodeTrieNode>;
|
||||
o?: string;
|
||||
};
|
||||
declare const _default: Map<number, EncodeTrieNode>;
|
||||
export default _default;
|
||||
//# sourceMappingURL=encode-html.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/encode-html.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/encode-html.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"encode-html.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/encode-html.ts"],"names":[],"mappings":"AAEA,KAAK,cAAc,GACb,MAAM,GACN;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;;AAY1E,wBAAo+tB"}
|
||||
10
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/encode-html.js
generated
vendored
Normal file
10
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/encode-html.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/encode-html.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/generated/encode-html.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
96
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/index.d.ts
generated
vendored
Normal file
96
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
import { DecodingMode } from "./decode.js";
|
||||
/** The level of entities to support. */
|
||||
export declare enum EntityLevel {
|
||||
/** Support only XML entities. */
|
||||
XML = 0,
|
||||
/** Support HTML entities, which are a superset of XML entities. */
|
||||
HTML = 1
|
||||
}
|
||||
export declare enum EncodingMode {
|
||||
/**
|
||||
* The output is UTF-8 encoded. Only characters that need escaping within
|
||||
* XML will be escaped.
|
||||
*/
|
||||
UTF8 = 0,
|
||||
/**
|
||||
* The output consists only of ASCII characters. Characters that need
|
||||
* escaping within HTML, and characters that aren't ASCII characters will
|
||||
* be escaped.
|
||||
*/
|
||||
ASCII = 1,
|
||||
/**
|
||||
* Encode all characters that have an equivalent entity, as well as all
|
||||
* characters that are not ASCII characters.
|
||||
*/
|
||||
Extensive = 2,
|
||||
/**
|
||||
* Encode all characters that have to be escaped in HTML attributes,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*/
|
||||
Attribute = 3,
|
||||
/**
|
||||
* Encode all characters that have to be escaped in HTML text,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*/
|
||||
Text = 4
|
||||
}
|
||||
export interface DecodingOptions {
|
||||
/**
|
||||
* The level of entities to support.
|
||||
* @default {@link EntityLevel.XML}
|
||||
*/
|
||||
level?: EntityLevel;
|
||||
/**
|
||||
* Decoding mode. If `Legacy`, will support legacy entities not terminated
|
||||
* with a semicolon (`;`).
|
||||
*
|
||||
* Always `Strict` for XML. For HTML, set this to `true` if you are parsing
|
||||
* an attribute value.
|
||||
*
|
||||
* The deprecated `decodeStrict` function defaults this to `Strict`.
|
||||
*
|
||||
* @default {@link DecodingMode.Legacy}
|
||||
*/
|
||||
mode?: DecodingMode | undefined;
|
||||
}
|
||||
/**
|
||||
* Decodes a string with entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
*/
|
||||
export declare function decode(data: string, options?: DecodingOptions | EntityLevel): string;
|
||||
/**
|
||||
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
* @deprecated Use `decode` with the `mode` set to `Strict`.
|
||||
*/
|
||||
export declare function decodeStrict(data: string, options?: DecodingOptions | EntityLevel): string;
|
||||
/**
|
||||
* Options for `encode`.
|
||||
*/
|
||||
export interface EncodingOptions {
|
||||
/**
|
||||
* The level of entities to support.
|
||||
* @default {@link EntityLevel.XML}
|
||||
*/
|
||||
level?: EntityLevel;
|
||||
/**
|
||||
* Output format.
|
||||
* @default {@link EncodingMode.Extensive}
|
||||
*/
|
||||
mode?: EncodingMode;
|
||||
}
|
||||
/**
|
||||
* Encodes a string with entities.
|
||||
*
|
||||
* @param data String to encode.
|
||||
* @param options Encoding options.
|
||||
*/
|
||||
export declare function encode(data: string, options?: EncodingOptions | EntityLevel): string;
|
||||
export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js";
|
||||
export { encodeHTML, encodeNonAsciiHTML, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js";
|
||||
export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/index.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/index.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,YAAY,EAAE,MAAM,aAAa,CAAC;AASlE,wCAAwC;AACxC,oBAAY,WAAW;IACnB,iCAAiC;IACjC,GAAG,IAAI;IACP,mEAAmE;IACnE,IAAI,IAAI;CACX;AAED,oBAAY,YAAY;IACpB;;;OAGG;IACH,IAAI,IAAA;IACJ;;;;OAIG;IACH,KAAK,IAAA;IACL;;;OAGG;IACH,SAAS,IAAA;IACT;;;OAGG;IACH,SAAS,IAAA;IACT;;;OAGG;IACH,IAAI,IAAA;CACP;AAED,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAKR;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAkBR;AAED,OAAO,EACH,SAAS,EACT,MAAM,EACN,UAAU,EACV,eAAe,EACf,UAAU,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,UAAU,EACV,kBAAkB,EAElB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EAEnB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,aAAa,CAAC"}
|
||||
99
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/index.js
generated
vendored
Normal file
99
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
import { decodeXML, decodeHTML, DecodingMode } from "./decode.js";
|
||||
import { encodeHTML, encodeNonAsciiHTML } from "./encode.js";
|
||||
import { encodeXML, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js";
|
||||
/** The level of entities to support. */
|
||||
export var EntityLevel;
|
||||
(function (EntityLevel) {
|
||||
/** Support only XML entities. */
|
||||
EntityLevel[EntityLevel["XML"] = 0] = "XML";
|
||||
/** Support HTML entities, which are a superset of XML entities. */
|
||||
EntityLevel[EntityLevel["HTML"] = 1] = "HTML";
|
||||
})(EntityLevel || (EntityLevel = {}));
|
||||
export var EncodingMode;
|
||||
(function (EncodingMode) {
|
||||
/**
|
||||
* The output is UTF-8 encoded. Only characters that need escaping within
|
||||
* XML will be escaped.
|
||||
*/
|
||||
EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8";
|
||||
/**
|
||||
* The output consists only of ASCII characters. Characters that need
|
||||
* escaping within HTML, and characters that aren't ASCII characters will
|
||||
* be escaped.
|
||||
*/
|
||||
EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII";
|
||||
/**
|
||||
* Encode all characters that have an equivalent entity, as well as all
|
||||
* characters that are not ASCII characters.
|
||||
*/
|
||||
EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive";
|
||||
/**
|
||||
* Encode all characters that have to be escaped in HTML attributes,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*/
|
||||
EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute";
|
||||
/**
|
||||
* Encode all characters that have to be escaped in HTML text,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*/
|
||||
EncodingMode[EncodingMode["Text"] = 4] = "Text";
|
||||
})(EncodingMode || (EncodingMode = {}));
|
||||
/**
|
||||
* Decodes a string with entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
*/
|
||||
export function decode(data, options = EntityLevel.XML) {
|
||||
const level = typeof options === "number" ? options : options.level;
|
||||
if (level === EntityLevel.HTML) {
|
||||
const mode = typeof options === "object" ? options.mode : undefined;
|
||||
return decodeHTML(data, mode);
|
||||
}
|
||||
return decodeXML(data);
|
||||
}
|
||||
/**
|
||||
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
* @deprecated Use `decode` with the `mode` set to `Strict`.
|
||||
*/
|
||||
export function decodeStrict(data, options = EntityLevel.XML) {
|
||||
var _a;
|
||||
const opts = typeof options === "number" ? { level: options } : options;
|
||||
(_a = opts.mode) !== null && _a !== void 0 ? _a : (opts.mode = DecodingMode.Strict);
|
||||
return decode(data, opts);
|
||||
}
|
||||
/**
|
||||
* Encodes a string with entities.
|
||||
*
|
||||
* @param data String to encode.
|
||||
* @param options Encoding options.
|
||||
*/
|
||||
export function encode(data, options = EntityLevel.XML) {
|
||||
const opts = typeof options === "number" ? { level: options } : options;
|
||||
// Mode `UTF8` just escapes XML entities
|
||||
if (opts.mode === EncodingMode.UTF8)
|
||||
return escapeUTF8(data);
|
||||
if (opts.mode === EncodingMode.Attribute)
|
||||
return escapeAttribute(data);
|
||||
if (opts.mode === EncodingMode.Text)
|
||||
return escapeText(data);
|
||||
if (opts.level === EntityLevel.HTML) {
|
||||
if (opts.mode === EncodingMode.ASCII) {
|
||||
return encodeNonAsciiHTML(data);
|
||||
}
|
||||
return encodeHTML(data);
|
||||
}
|
||||
// ASCII and Extensive are equivalent
|
||||
return encodeXML(data);
|
||||
}
|
||||
export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js";
|
||||
export { encodeHTML, encodeNonAsciiHTML,
|
||||
// Legacy aliases (deprecated)
|
||||
encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js";
|
||||
export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute,
|
||||
// Legacy aliases (deprecated)
|
||||
decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js";
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/index.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/index.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACH,SAAS,EACT,UAAU,EACV,eAAe,EACf,UAAU,GACb,MAAM,aAAa,CAAC;AAErB,wCAAwC;AACxC,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,iCAAiC;IACjC,2CAAO,CAAA;IACP,mEAAmE;IACnE,6CAAQ,CAAA;AACZ,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,MAAM,CAAN,IAAY,YA2BX;AA3BD,WAAY,YAAY;IACpB;;;OAGG;IACH,+CAAI,CAAA;IACJ;;;;OAIG;IACH,iDAAK,CAAA;IACL;;;OAGG;IACH,yDAAS,CAAA;IACT;;;OAGG;IACH,yDAAS,CAAA;IACT;;;OAGG;IACH,+CAAI,CAAA;AACR,CAAC,EA3BW,YAAY,KAAZ,YAAY,QA2BvB;AAsBD;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAClB,IAAY,EACZ,UAAyC,WAAW,CAAC,GAAG;IAExD,MAAM,KAAK,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAEpE,IAAI,KAAK,KAAK,WAAW,CAAC,IAAI,EAAE;QAC5B,MAAM,IAAI,GAAG,OAAO,OAAO,KAAK,QAAQ,CA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AED,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;KAC3B;IAED,qCAAqC;IACrC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,OAAO,EACH,SAAS,EACT,MAAM,EACN,UAAU,EACV,eAAe,EACf,UAAU,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,UAAU,EACV,kBAAkB;AAClB,8BAA8B;AAC9B,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,mBAAmB;AACnB,8BAA8B;AAC9B,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,aAAa,CAAC"}
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/package.json
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/esm/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"type":"module"}
|
||||
3
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.d.ts
generated
vendored
Normal file
3
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
declare const _default: Uint16Array;
|
||||
export default _default;
|
||||
//# sourceMappingURL=decode-data-html.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode-data-html.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-html.ts"],"names":[],"mappings":";AAEA,wBAKE"}
|
||||
9
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js
generated
vendored
Normal file
9
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode-data-html.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-html.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAE9C,kBAAe,IAAI,WAAW;AAC1B,kBAAkB;AAClB,268CAA268C;KACt68C,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAf,CAAe,CAAC,CACnC,CAAC"}
|
||||
3
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.d.ts
generated
vendored
Normal file
3
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
declare const _default: Uint16Array;
|
||||
export default _default;
|
||||
//# sourceMappingURL=decode-data-xml.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode-data-xml.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-xml.ts"],"names":[],"mappings":";AAEA,wBAKE"}
|
||||
9
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js
generated
vendored
Normal file
9
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
"use strict";
|
||||
// Generated using scripts/write-decode-map.ts
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = new Uint16Array(
|
||||
// prettier-ignore
|
||||
"\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022"
|
||||
.split("")
|
||||
.map(function (c) { return c.charCodeAt(0); }));
|
||||
//# sourceMappingURL=decode-data-xml.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"decode-data-xml.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/decode-data-xml.ts"],"names":[],"mappings":";AAAA,8CAA8C;;AAE9C,kBAAe,IAAI,WAAW;AAC1B,kBAAkB;AAClB,uFAAuF;KAClF,KAAK,CAAC,EAAE,CAAC;KACT,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAf,CAAe,CAAC,CACnC,CAAC"}
|
||||
8
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.d.ts
generated
vendored
Normal file
8
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
type EncodeTrieNode = string | {
|
||||
v?: string;
|
||||
n: number | Map<number, EncodeTrieNode>;
|
||||
o?: string;
|
||||
};
|
||||
declare const _default: Map<number, EncodeTrieNode>;
|
||||
export default _default;
|
||||
//# sourceMappingURL=encode-html.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"encode-html.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["generated/encode-html.ts"],"names":[],"mappings":"AAEA,KAAK,cAAc,GACb,MAAM,GACN;IAAE,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;;AAY1E,wBAAo+tB"}
|
||||
12
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js
generated
vendored
Normal file
12
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
96
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts
generated
vendored
Normal file
96
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
import { DecodingMode } from "./decode.js";
|
||||
/** The level of entities to support. */
|
||||
export declare enum EntityLevel {
|
||||
/** Support only XML entities. */
|
||||
XML = 0,
|
||||
/** Support HTML entities, which are a superset of XML entities. */
|
||||
HTML = 1
|
||||
}
|
||||
export declare enum EncodingMode {
|
||||
/**
|
||||
* The output is UTF-8 encoded. Only characters that need escaping within
|
||||
* XML will be escaped.
|
||||
*/
|
||||
UTF8 = 0,
|
||||
/**
|
||||
* The output consists only of ASCII characters. Characters that need
|
||||
* escaping within HTML, and characters that aren't ASCII characters will
|
||||
* be escaped.
|
||||
*/
|
||||
ASCII = 1,
|
||||
/**
|
||||
* Encode all characters that have an equivalent entity, as well as all
|
||||
* characters that are not ASCII characters.
|
||||
*/
|
||||
Extensive = 2,
|
||||
/**
|
||||
* Encode all characters that have to be escaped in HTML attributes,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*/
|
||||
Attribute = 3,
|
||||
/**
|
||||
* Encode all characters that have to be escaped in HTML text,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*/
|
||||
Text = 4
|
||||
}
|
||||
export interface DecodingOptions {
|
||||
/**
|
||||
* The level of entities to support.
|
||||
* @default {@link EntityLevel.XML}
|
||||
*/
|
||||
level?: EntityLevel;
|
||||
/**
|
||||
* Decoding mode. If `Legacy`, will support legacy entities not terminated
|
||||
* with a semicolon (`;`).
|
||||
*
|
||||
* Always `Strict` for XML. For HTML, set this to `true` if you are parsing
|
||||
* an attribute value.
|
||||
*
|
||||
* The deprecated `decodeStrict` function defaults this to `Strict`.
|
||||
*
|
||||
* @default {@link DecodingMode.Legacy}
|
||||
*/
|
||||
mode?: DecodingMode | undefined;
|
||||
}
|
||||
/**
|
||||
* Decodes a string with entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
*/
|
||||
export declare function decode(data: string, options?: DecodingOptions | EntityLevel): string;
|
||||
/**
|
||||
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
* @deprecated Use `decode` with the `mode` set to `Strict`.
|
||||
*/
|
||||
export declare function decodeStrict(data: string, options?: DecodingOptions | EntityLevel): string;
|
||||
/**
|
||||
* Options for `encode`.
|
||||
*/
|
||||
export interface EncodingOptions {
|
||||
/**
|
||||
* The level of entities to support.
|
||||
* @default {@link EntityLevel.XML}
|
||||
*/
|
||||
level?: EntityLevel;
|
||||
/**
|
||||
* Output format.
|
||||
* @default {@link EncodingMode.Extensive}
|
||||
*/
|
||||
mode?: EncodingMode;
|
||||
}
|
||||
/**
|
||||
* Encodes a string with entities.
|
||||
*
|
||||
* @param data String to encode.
|
||||
* @param options Encoding options.
|
||||
*/
|
||||
export declare function encode(data: string, options?: EncodingOptions | EntityLevel): string;
|
||||
export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js";
|
||||
export { encodeHTML, encodeNonAsciiHTML, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js";
|
||||
export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,YAAY,EAAE,MAAM,aAAa,CAAC;AASlE,wCAAwC;AAC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,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,aAAa,CAAC"}
|
||||
126
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/index.js
generated
vendored
Normal file
126
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLAttribute = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.DecodingMode = exports.EntityDecoder = exports.encodeHTML5 = exports.encodeHTML4 = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.EntityLevel = void 0;
|
||||
var decode_js_1 = require("./decode.js");
|
||||
var encode_js_1 = require("./encode.js");
|
||||
var escape_js_1 = require("./escape.js");
|
||||
/** The level of entities to support. */
|
||||
var EntityLevel;
|
||||
(function (EntityLevel) {
|
||||
/** Support only XML entities. */
|
||||
EntityLevel[EntityLevel["XML"] = 0] = "XML";
|
||||
/** Support HTML entities, which are a superset of XML entities. */
|
||||
EntityLevel[EntityLevel["HTML"] = 1] = "HTML";
|
||||
})(EntityLevel = exports.EntityLevel || (exports.EntityLevel = {}));
|
||||
var EncodingMode;
|
||||
(function (EncodingMode) {
|
||||
/**
|
||||
* The output is UTF-8 encoded. Only characters that need escaping within
|
||||
* XML will be escaped.
|
||||
*/
|
||||
EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8";
|
||||
/**
|
||||
* The output consists only of ASCII characters. Characters that need
|
||||
* escaping within HTML, and characters that aren't ASCII characters will
|
||||
* be escaped.
|
||||
*/
|
||||
EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII";
|
||||
/**
|
||||
* Encode all characters that have an equivalent entity, as well as all
|
||||
* characters that are not ASCII characters.
|
||||
*/
|
||||
EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive";
|
||||
/**
|
||||
* Encode all characters that have to be escaped in HTML attributes,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*/
|
||||
EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute";
|
||||
/**
|
||||
* Encode all characters that have to be escaped in HTML text,
|
||||
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
||||
*/
|
||||
EncodingMode[EncodingMode["Text"] = 4] = "Text";
|
||||
})(EncodingMode = exports.EncodingMode || (exports.EncodingMode = {}));
|
||||
/**
|
||||
* Decodes a string with entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
*/
|
||||
function decode(data, options) {
|
||||
if (options === void 0) { options = EntityLevel.XML; }
|
||||
var level = typeof options === "number" ? options : options.level;
|
||||
if (level === EntityLevel.HTML) {
|
||||
var mode = typeof options === "object" ? options.mode : undefined;
|
||||
return (0, decode_js_1.decodeHTML)(data, mode);
|
||||
}
|
||||
return (0, decode_js_1.decodeXML)(data);
|
||||
}
|
||||
exports.decode = decode;
|
||||
/**
|
||||
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
|
||||
*
|
||||
* @param data String to decode.
|
||||
* @param options Decoding options.
|
||||
* @deprecated Use `decode` with the `mode` set to `Strict`.
|
||||
*/
|
||||
function decodeStrict(data, options) {
|
||||
var _a;
|
||||
if (options === void 0) { options = EntityLevel.XML; }
|
||||
var opts = typeof options === "number" ? { level: options } : options;
|
||||
(_a = opts.mode) !== null && _a !== void 0 ? _a : (opts.mode = decode_js_1.DecodingMode.Strict);
|
||||
return decode(data, opts);
|
||||
}
|
||||
exports.decodeStrict = decodeStrict;
|
||||
/**
|
||||
* Encodes a string with entities.
|
||||
*
|
||||
* @param data String to encode.
|
||||
* @param options Encoding options.
|
||||
*/
|
||||
function encode(data, options) {
|
||||
if (options === void 0) { options = EntityLevel.XML; }
|
||||
var opts = typeof options === "number" ? { level: options } : options;
|
||||
// Mode `UTF8` just escapes XML entities
|
||||
if (opts.mode === EncodingMode.UTF8)
|
||||
return (0, escape_js_1.escapeUTF8)(data);
|
||||
if (opts.mode === EncodingMode.Attribute)
|
||||
return (0, escape_js_1.escapeAttribute)(data);
|
||||
if (opts.mode === EncodingMode.Text)
|
||||
return (0, escape_js_1.escapeText)(data);
|
||||
if (opts.level === EntityLevel.HTML) {
|
||||
if (opts.mode === EncodingMode.ASCII) {
|
||||
return (0, encode_js_1.encodeNonAsciiHTML)(data);
|
||||
}
|
||||
return (0, encode_js_1.encodeHTML)(data);
|
||||
}
|
||||
// ASCII and Extensive are equivalent
|
||||
return (0, escape_js_1.encodeXML)(data);
|
||||
}
|
||||
exports.encode = encode;
|
||||
var escape_js_2 = require("./escape.js");
|
||||
Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return escape_js_2.encodeXML; } });
|
||||
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
|
||||
Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function () { return escape_js_2.escapeUTF8; } });
|
||||
Object.defineProperty(exports, "escapeAttribute", { enumerable: true, get: function () { return escape_js_2.escapeAttribute; } });
|
||||
Object.defineProperty(exports, "escapeText", { enumerable: true, get: function () { return escape_js_2.escapeText; } });
|
||||
var encode_js_2 = require("./encode.js");
|
||||
Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
|
||||
Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function () { return encode_js_2.encodeNonAsciiHTML; } });
|
||||
// Legacy aliases (deprecated)
|
||||
Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
|
||||
Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
|
||||
var decode_js_2 = require("./decode.js");
|
||||
Object.defineProperty(exports, "EntityDecoder", { enumerable: true, get: function () { return decode_js_2.EntityDecoder; } });
|
||||
Object.defineProperty(exports, "DecodingMode", { enumerable: true, get: function () { return decode_js_2.DecodingMode; } });
|
||||
Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_js_2.decodeXML; } });
|
||||
Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
|
||||
Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
|
||||
Object.defineProperty(exports, "decodeHTMLAttribute", { enumerable: true, get: function () { return decode_js_2.decodeHTMLAttribute; } });
|
||||
// Legacy aliases (deprecated)
|
||||
Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
|
||||
Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
|
||||
Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
|
||||
Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
|
||||
Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeXML; } });
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/index.js.map
generated
vendored
Normal file
1
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/lib/index.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,yCAAkE;AAClE,yCAA6D;AAC7D,yCAKqB;AAErB,wCAAwC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UAAU,OAAe;AACzB,wGAAA,UAAU,OAAe;AAG7B,yCAaqB;AAZjB,0GAAA,aAAa,OAAA;AACb,yGAAA,YAAY,OAAA;AACZ,sGAAA,SAAS,OAAA;AACT,uGAAA,UAAU,OAAA;AACV,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,8BAA8B;AAC9B,wGAAA,UAAU,OAAe;AACzB,wGAAA,UAAU,OAAe;AACzB,8GAAA,gBAAgB,OAAqB;AACrC,8GAAA,gBAAgB,OAAqB;AACrC,4GAAA,SAAS,OAAmB"}
|
||||
90
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/package.json
generated
vendored
Normal file
90
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
"name": "entities",
|
||||
"version": "4.5.0",
|
||||
"description": "Encode & decode XML and HTML entities with ease & speed",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"funding": "https://github.com/fb55/entities?sponsor=1",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"entity",
|
||||
"decoding",
|
||||
"encoding",
|
||||
"html",
|
||||
"xml",
|
||||
"html entities"
|
||||
],
|
||||
"directories": {
|
||||
"lib": "lib/"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"module": "lib/esm/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": "./lib/index.js",
|
||||
"import": "./lib/esm/index.js"
|
||||
},
|
||||
"./lib/decode.js": {
|
||||
"require": "./lib/decode.js",
|
||||
"import": "./lib/esm/decode.js"
|
||||
},
|
||||
"./lib/escape.js": {
|
||||
"require": "./lib/escape.js",
|
||||
"import": "./lib/esm/escape.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"lib/**/*"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^28.1.8",
|
||||
"@types/node": "^18.15.11",
|
||||
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
||||
"@typescript-eslint/parser": "^5.58.0",
|
||||
"eslint": "^8.38.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"jest": "^28.1.3",
|
||||
"prettier": "^2.8.7",
|
||||
"ts-jest": "^28.0.8",
|
||||
"typedoc": "^0.24.1",
|
||||
"typescript": "^5.0.4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "npm run test:jest && npm run lint",
|
||||
"test:jest": "jest",
|
||||
"lint": "npm run lint:es && npm run lint:prettier",
|
||||
"lint:es": "eslint .",
|
||||
"lint:prettier": "npm run prettier -- --check",
|
||||
"format": "npm run format:es && npm run format:prettier",
|
||||
"format:es": "npm run lint:es -- --fix",
|
||||
"format:prettier": "npm run prettier -- --write",
|
||||
"prettier": "prettier '**/*.{ts,md,json,yml}'",
|
||||
"build": "npm run build:cjs && npm run build:esm",
|
||||
"build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/entities/$(git rev-parse HEAD)/src/",
|
||||
"build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
|
||||
"build:docs": "typedoc --hideGenerator src/index.ts",
|
||||
"build:trie": "ts-node scripts/write-decode-map.ts",
|
||||
"build:encode-trie": "ts-node scripts/write-encode-map.ts",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/fb55/entities.git"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"coverageProvider": "v8",
|
||||
"moduleNameMapper": {
|
||||
"^(.*)\\.js$": "$1"
|
||||
}
|
||||
},
|
||||
"prettier": {
|
||||
"tabWidth": 4,
|
||||
"proseWrap": "always"
|
||||
}
|
||||
}
|
||||
122
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/readme.md
generated
vendored
Normal file
122
Frontend-Learner/node_modules/dom-serializer/node_modules/entities/readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
# entities [](https://npmjs.org/package/entities) [](https://npmjs.org/package/entities) [](https://github.com/fb55/entities/actions/workflows/nodejs-test.yml)
|
||||
|
||||
Encode & decode HTML & XML entities with ease & speed.
|
||||
|
||||
## Features
|
||||
|
||||
- 😇 Tried and true: `entities` is used by many popular libraries; eg.
|
||||
[`htmlparser2`](https://github.com/fb55/htmlparser2), the official
|
||||
[AWS SDK](https://github.com/aws/aws-sdk-js-v3) and
|
||||
[`commonmark`](https://github.com/commonmark/commonmark.js) use it to
|
||||
process HTML entities.
|
||||
- ⚡️ Fast: `entities` is the fastest library for decoding HTML entities (as
|
||||
of April 2022); see [performance](#performance).
|
||||
- 🎛 Configurable: Get an output tailored for your needs. You are fine with
|
||||
UTF8? That'll save you some bytes. Prefer to only have ASCII characters? We
|
||||
can do that as well!
|
||||
|
||||
## How to…
|
||||
|
||||
### …install `entities`
|
||||
|
||||
npm install entities
|
||||
|
||||
### …use `entities`
|
||||
|
||||
```javascript
|
||||
const entities = require("entities");
|
||||
|
||||
// Encoding
|
||||
entities.escapeUTF8("& ü"); // "&#38; ü"
|
||||
entities.encodeXML("& ü"); // "&#38; ü"
|
||||
entities.encodeHTML("& ü"); // "&#38; ü"
|
||||
|
||||
// Decoding
|
||||
entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
||||
entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
This is how `entities` compares to other libraries on a very basic benchmark
|
||||
(see `scripts/benchmark.ts`, for 10,000,000 iterations; **lower is better**):
|
||||
|
||||
| Library | Version | `decode` perf | `encode` perf | `escape` perf |
|
||||
| -------------- | ------- | ------------- | ------------- | ------------- |
|
||||
| entities | `3.0.1` | 1.418s | 6.786s | 2.196s |
|
||||
| html-entities | `2.3.2` | 2.530s | 6.829s | 2.415s |
|
||||
| he | `1.2.0` | 5.800s | 24.237s | 3.624s |
|
||||
| parse-entities | `3.0.0` | 9.660s | N/A | N/A |
|
||||
|
||||
---
|
||||
|
||||
## FAQ
|
||||
|
||||
> What methods should I actually use to encode my documents?
|
||||
|
||||
If your target supports UTF-8, the `escapeUTF8` method is going to be your best
|
||||
choice. Otherwise, use either `encodeHTML` or `encodeXML` based on whether
|
||||
you're dealing with an HTML or an XML document.
|
||||
|
||||
You can have a look at the options for the `encode` and `decode` methods to see
|
||||
everything you can configure.
|
||||
|
||||
> When should I use strict decoding?
|
||||
|
||||
When strict decoding, entities not terminated with a semicolon will be ignored.
|
||||
This is helpful for decoding entities in legacy environments.
|
||||
|
||||
> Why should I use `entities` instead of alternative modules?
|
||||
|
||||
As of April 2022, `entities` is a bit faster than other modules. Still, this is
|
||||
not a very differentiated space and other modules can catch up.
|
||||
|
||||
**More importantly**, you might already have `entities` in your dependency graph
|
||||
(as a dependency of eg. `cheerio`, or `htmlparser2`), and including it directly
|
||||
might not even increase your bundle size. The same is true for other entity
|
||||
libraries, so have a look through your `node_modules` directory!
|
||||
|
||||
> Does `entities` support tree shaking?
|
||||
|
||||
Yes! `entities` ships as both a CommonJS and a ES module. Note that for best
|
||||
results, you should not use the `encode` and `decode` functions, as they wrap
|
||||
around a number of other functions, all of which will remain in the bundle.
|
||||
Instead, use the functions that you need directly.
|
||||
|
||||
---
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
This library wouldn't be possible without the work of these individuals. Thanks
|
||||
to
|
||||
|
||||
- [@mathiasbynens](https://github.com/mathiasbynens) for his explanations
|
||||
about character encodings, and his library `he`, which was one of the
|
||||
inspirations for `entities`
|
||||
- [@inikulin](https://github.com/inikulin) for his work on optimized tries for
|
||||
decoding HTML entities for the `parse5` project
|
||||
- [@mdevils](https://github.com/mdevils) for taking on the challenge of
|
||||
producing a quick entity library with his `html-entities` library.
|
||||
`entities` would be quite a bit slower if there wasn't any competition.
|
||||
Right now `entities` is on top, but we'll see how long that lasts!
|
||||
|
||||
---
|
||||
|
||||
License: BSD-2-Clause
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the
|
||||
[Tidelift security contact](https://tidelift.com/security). Tidelift will
|
||||
coordinate the fix and disclosure.
|
||||
|
||||
## `entities` for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of `entities` and thousands of other packages are working with
|
||||
Tidelift to deliver commercial support and maintenance for the open source
|
||||
dependencies you use to build your applications. Save time, reduce risk, and
|
||||
improve code health, while paying the maintainers of the exact dependencies you
|
||||
use.
|
||||
[Learn more.](https://tidelift.com/subscription/pkg/npm-entities?utm_source=npm-entities&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
69
Frontend-Learner/node_modules/dom-serializer/package.json
generated
vendored
Normal file
69
Frontend-Learner/node_modules/dom-serializer/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"name": "dom-serializer",
|
||||
"version": "2.0.0",
|
||||
"description": "render domhandler DOM nodes to a string",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"sideEffects": false,
|
||||
"keywords": [
|
||||
"html",
|
||||
"xml",
|
||||
"render"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/cheeriojs/dom-serializer.git"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"module": "lib/esm/index.js",
|
||||
"exports": {
|
||||
"require": "./lib/index.js",
|
||||
"import": "./lib/esm/index.js"
|
||||
},
|
||||
"files": [
|
||||
"lib/**/*"
|
||||
],
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.3.0",
|
||||
"domhandler": "^5.0.2",
|
||||
"entities": "^4.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "^17.0.23",
|
||||
"@typescript-eslint/eslint-plugin": "^5.18.0",
|
||||
"@typescript-eslint/parser": "^5.18.0",
|
||||
"cheerio": "^1.0.0-rc.9",
|
||||
"eslint": "^8.12.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"htmlparser2": "^7.2.0",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.6.2",
|
||||
"ts-jest": "^27.1.4",
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "npm run test:jest && npm run lint",
|
||||
"test:jest": "jest",
|
||||
"lint": "npm run lint:es && npm run lint:prettier",
|
||||
"lint:es": "eslint --ignore-path .gitignore .",
|
||||
"lint:prettier": "npm run prettier -- --check",
|
||||
"format": "npm run format:es && npm run format:prettier",
|
||||
"format:es": "npm run lint:es -- --fix",
|
||||
"format:prettier": "npm run prettier -- --write",
|
||||
"prettier": "prettier \"**/*.{ts,md,json,yml}\" --ignore-path .gitignore",
|
||||
"build": "npm run build:cjs && npm run build:esm",
|
||||
"build:cjs": "tsc",
|
||||
"build:esm": "tsc --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testEnvironment": "node",
|
||||
"moduleNameMapper": {
|
||||
"^(.*)\\.js$": "$1"
|
||||
}
|
||||
},
|
||||
"funding": "https://github.com/cheeriojs/dom-serializer?sponsor=1",
|
||||
"license": "MIT"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue