Upload folder using huggingface_hub (part 12)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- node_modules/entities/LICENSE +11 -0
- node_modules/entities/dist/internal/decode-shared.d.ts.map +1 -0
- node_modules/entities/dist/internal/decode-shared.js +17 -0
- node_modules/entities/dist/internal/decode-shared.js.map +1 -0
- node_modules/entities/dist/internal/encode-shared.d.ts +33 -0
- node_modules/entities/dist/internal/encode-shared.d.ts.map +1 -0
- node_modules/entities/dist/internal/encode-shared.js +93 -0
- node_modules/entities/dist/internal/encode-shared.js.map +1 -0
- node_modules/entities/package.json +83 -0
- node_modules/entities/readme.md +131 -0
- node_modules/entities/src/decode-codepoint.ts +50 -0
- node_modules/entities/src/decode.ts +671 -0
- node_modules/entities/src/encode.ts +95 -0
- node_modules/entities/src/escape.ts +160 -0
- node_modules/entities/src/generated/decode-data-html.ts +7 -0
- node_modules/entities/src/generated/decode-data-xml.ts +7 -0
- node_modules/entities/src/generated/encode-html.ts +18 -0
- node_modules/entities/src/index.ts +162 -0
- node_modules/entities/src/internal/bin-trie-flags.ts +16 -0
- node_modules/entities/src/internal/decode-shared.ts +18 -0
- node_modules/entities/src/internal/encode-shared.ts +123 -0
- node_modules/es-define-property/.eslintrc +13 -0
- node_modules/es-define-property/.github/FUNDING.yml +12 -0
- node_modules/es-define-property/.nycrc +9 -0
- node_modules/es-define-property/CHANGELOG.md +29 -0
- node_modules/es-define-property/LICENSE +21 -0
- node_modules/es-define-property/README.md +49 -0
- node_modules/es-define-property/index.d.ts +3 -0
- node_modules/es-define-property/index.js +14 -0
- node_modules/es-define-property/package.json +81 -0
- node_modules/es-define-property/test/index.js +56 -0
- node_modules/es-define-property/tsconfig.json +10 -0
- node_modules/es-errors/.eslintrc +5 -0
- node_modules/es-errors/.github/FUNDING.yml +12 -0
- node_modules/es-errors/CHANGELOG.md +40 -0
- node_modules/es-errors/LICENSE +21 -0
- node_modules/es-errors/README.md +55 -0
- node_modules/es-errors/eval.d.ts +3 -0
- node_modules/es-errors/eval.js +4 -0
- node_modules/es-errors/index.d.ts +3 -0
- node_modules/es-errors/index.js +4 -0
- node_modules/es-errors/package.json +80 -0
- node_modules/es-errors/range.d.ts +3 -0
- node_modules/es-errors/range.js +4 -0
- node_modules/es-errors/ref.d.ts +3 -0
- node_modules/es-errors/ref.js +4 -0
- node_modules/es-errors/syntax.d.ts +3 -0
- node_modules/es-errors/syntax.js +4 -0
- node_modules/es-errors/test/index.js +19 -0
- node_modules/es-errors/tsconfig.json +49 -0
node_modules/entities/LICENSE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright (c) Felix Böhm
|
| 2 |
+
All rights reserved.
|
| 3 |
+
|
| 4 |
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
| 5 |
+
|
| 6 |
+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
| 7 |
+
|
| 8 |
+
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.
|
| 9 |
+
|
| 10 |
+
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,
|
| 11 |
+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
node_modules/entities/dist/internal/decode-shared.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"decode-shared.d.ts","sourceRoot":"","sources":["../../src/internal/decode-shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAYvD"}
|
node_modules/entities/dist/internal/decode-shared.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Shared base64 decode helper for generated decode data.
|
| 3 |
+
* Assumes global atob is available.
|
| 4 |
+
* @param input Input string to encode or decode.
|
| 5 |
+
*/
|
| 6 |
+
export function decodeBase64(input) {
|
| 7 |
+
const binary = atob(input);
|
| 8 |
+
const evenLength = binary.length & ~1; // Round down to even length
|
| 9 |
+
const out = new Uint16Array(evenLength / 2);
|
| 10 |
+
for (let index = 0, outIndex = 0; index < evenLength; index += 2) {
|
| 11 |
+
const lo = binary.charCodeAt(index);
|
| 12 |
+
const hi = binary.charCodeAt(index + 1);
|
| 13 |
+
out[outIndex++] = lo | (hi << 8);
|
| 14 |
+
}
|
| 15 |
+
return out;
|
| 16 |
+
}
|
| 17 |
+
//# sourceMappingURL=decode-shared.js.map
|
node_modules/entities/dist/internal/decode-shared.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"decode-shared.js","sourceRoot":"","sources":["../../src/internal/decode-shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,MAAM,MAAM,GAAW,IAAI,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,4BAA4B;IACnE,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAE5C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,QAAQ,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC/D,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACxC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC"}
|
node_modules/entities/dist/internal/encode-shared.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* A node inside the encoding trie used by `encode.ts`.
|
| 3 |
+
*
|
| 4 |
+
* There are two physical shapes to minimize allocations and lookup cost:
|
| 5 |
+
*
|
| 6 |
+
* 1. Leaf node (string)
|
| 7 |
+
* - A plain string (already in the form `"&name;"`).
|
| 8 |
+
* - Represents a terminal match with no children.
|
| 9 |
+
*
|
| 10 |
+
* 2. Branch / value node (object)
|
| 11 |
+
*/
|
| 12 |
+
export type EncodeTrieNode = string | {
|
| 13 |
+
/**
|
| 14 |
+
* Entity value for the current code point sequence (wrapped: `&...;`).
|
| 15 |
+
* Present when the path to this node itself is a valid named entity.
|
| 16 |
+
*/
|
| 17 |
+
value: string | undefined;
|
| 18 |
+
/** If a number, the next code unit of the only next character. */
|
| 19 |
+
next: number | Map<number, EncodeTrieNode>;
|
| 20 |
+
/** If next is a number, `nextValue` contains the entity value. */
|
| 21 |
+
nextValue?: string;
|
| 22 |
+
};
|
| 23 |
+
/**
|
| 24 |
+
* Parse a compact encode trie string into a Map structure used for encoding.
|
| 25 |
+
*
|
| 26 |
+
* Format per entry (ascending code points using delta encoding):
|
| 27 |
+
* <diffBase36>[&name;][{<children>}] -- diff omitted when 0
|
| 28 |
+
* Where diff = currentKey - previousKey - 1 (first entry stores absolute key).
|
| 29 |
+
* `&name;` is the entity value (already wrapped); a following `{` denotes children.
|
| 30 |
+
* @param serialized Serialized text fragment to encode.
|
| 31 |
+
*/
|
| 32 |
+
export declare function parseEncodeTrie(serialized: string): Map<number, EncodeTrieNode>;
|
| 33 |
+
//# sourceMappingURL=encode-shared.d.ts.map
|
node_modules/entities/dist/internal/encode-shared.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"encode-shared.d.ts","sourceRoot":"","sources":["../../src/internal/encode-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GACpB,MAAM,GACN;IACI;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,kEAAkE;IAClE,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC3C,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAER;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,MAAM,GACnB,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAsF7B"}
|
node_modules/entities/dist/internal/encode-shared.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Parse a compact encode trie string into a Map structure used for encoding.
|
| 3 |
+
*
|
| 4 |
+
* Format per entry (ascending code points using delta encoding):
|
| 5 |
+
* <diffBase36>[&name;][{<children>}] -- diff omitted when 0
|
| 6 |
+
* Where diff = currentKey - previousKey - 1 (first entry stores absolute key).
|
| 7 |
+
* `&name;` is the entity value (already wrapped); a following `{` denotes children.
|
| 8 |
+
* @param serialized Serialized text fragment to encode.
|
| 9 |
+
*/
|
| 10 |
+
export function parseEncodeTrie(serialized) {
|
| 11 |
+
const top = new Map();
|
| 12 |
+
const totalLength = serialized.length;
|
| 13 |
+
let cursor = 0;
|
| 14 |
+
let lastTopKey = -1;
|
| 15 |
+
function readDiff() {
|
| 16 |
+
const start = cursor;
|
| 17 |
+
while (cursor < totalLength) {
|
| 18 |
+
const char = serialized.charAt(cursor);
|
| 19 |
+
if ((char < "0" || char > "9") && (char < "a" || char > "z")) {
|
| 20 |
+
break;
|
| 21 |
+
}
|
| 22 |
+
cursor++;
|
| 23 |
+
}
|
| 24 |
+
if (cursor === start)
|
| 25 |
+
return 0;
|
| 26 |
+
return Number.parseInt(serialized.slice(start, cursor), 36);
|
| 27 |
+
}
|
| 28 |
+
function readEntity() {
|
| 29 |
+
if (serialized[cursor] !== "&") {
|
| 30 |
+
throw new Error(`Child entry missing value near index ${cursor}`);
|
| 31 |
+
}
|
| 32 |
+
// Cursor currently points at '&'
|
| 33 |
+
const start = cursor;
|
| 34 |
+
const end = serialized.indexOf(";", cursor + 1);
|
| 35 |
+
if (end === -1) {
|
| 36 |
+
throw new Error(`Unterminated entity starting at index ${start}`);
|
| 37 |
+
}
|
| 38 |
+
cursor = end + 1; // Move past ';'
|
| 39 |
+
return serialized.slice(start, cursor); // Includes & ... ;
|
| 40 |
+
}
|
| 41 |
+
while (cursor < totalLength) {
|
| 42 |
+
const keyDiff = readDiff();
|
| 43 |
+
const key = lastTopKey === -1 ? keyDiff : lastTopKey + keyDiff + 1;
|
| 44 |
+
let value;
|
| 45 |
+
if (serialized[cursor] === "&")
|
| 46 |
+
value = readEntity();
|
| 47 |
+
if (serialized[cursor] === "{") {
|
| 48 |
+
cursor++; // Skip '{'
|
| 49 |
+
// Parse first child
|
| 50 |
+
let diff = readDiff();
|
| 51 |
+
let childKey = diff; // First key (lastChildKey = -1)
|
| 52 |
+
const firstValue = readEntity();
|
| 53 |
+
if (serialized[cursor] === "{") {
|
| 54 |
+
throw new Error("Unexpected nested '{' beyond depth 2");
|
| 55 |
+
}
|
| 56 |
+
// If end of block -> single child optimization
|
| 57 |
+
if (serialized[cursor] === "}") {
|
| 58 |
+
top.set(key, { value, next: childKey, nextValue: firstValue });
|
| 59 |
+
cursor++; // Skip '}'
|
| 60 |
+
}
|
| 61 |
+
else {
|
| 62 |
+
const childMap = new Map([
|
| 63 |
+
[childKey, firstValue],
|
| 64 |
+
]);
|
| 65 |
+
let lastChildKey = childKey;
|
| 66 |
+
while (cursor < totalLength && serialized[cursor] !== "}") {
|
| 67 |
+
diff = readDiff();
|
| 68 |
+
childKey = lastChildKey + diff + 1;
|
| 69 |
+
const childValue = readEntity();
|
| 70 |
+
if (serialized[cursor] === "{") {
|
| 71 |
+
throw new Error("Unexpected nested '{' beyond depth 2");
|
| 72 |
+
}
|
| 73 |
+
childMap.set(childKey, childValue);
|
| 74 |
+
lastChildKey = childKey;
|
| 75 |
+
}
|
| 76 |
+
if (serialized[cursor] !== "}") {
|
| 77 |
+
throw new Error("Unterminated child block");
|
| 78 |
+
}
|
| 79 |
+
cursor++; // Skip '}'
|
| 80 |
+
top.set(key, { value, next: childMap });
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
else if (value === undefined) {
|
| 84 |
+
throw new Error(`Malformed encode trie: missing value at index ${cursor}`);
|
| 85 |
+
}
|
| 86 |
+
else {
|
| 87 |
+
top.set(key, value);
|
| 88 |
+
}
|
| 89 |
+
lastTopKey = key;
|
| 90 |
+
}
|
| 91 |
+
return top;
|
| 92 |
+
}
|
| 93 |
+
//# sourceMappingURL=encode-shared.js.map
|
node_modules/entities/dist/internal/encode-shared.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"encode-shared.js","sourceRoot":"","sources":["../../src/internal/encode-shared.ts"],"names":[],"mappings":"AAyBA;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC3B,UAAkB;IAElB,MAAM,GAAG,GAAG,IAAI,GAAG,EAA0B,CAAC;IAC9C,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC;IACtC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,UAAU,GAAG,CAAC,CAAC,CAAC;IAEpB,SAAS,QAAQ;QACb,MAAM,KAAK,GAAG,MAAM,CAAC;QACr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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "entities",
|
| 3 |
+
"version": "8.0.0",
|
| 4 |
+
"description": "Encode & decode XML and HTML entities with ease & speed",
|
| 5 |
+
"keywords": [
|
| 6 |
+
"html entities",
|
| 7 |
+
"entity decoder",
|
| 8 |
+
"entity encoding",
|
| 9 |
+
"html decoding",
|
| 10 |
+
"html encoding",
|
| 11 |
+
"xml decoding",
|
| 12 |
+
"xml encoding"
|
| 13 |
+
],
|
| 14 |
+
"repository": {
|
| 15 |
+
"type": "git",
|
| 16 |
+
"url": "https://github.com/fb55/entities.git"
|
| 17 |
+
},
|
| 18 |
+
"funding": "https://github.com/fb55/entities?sponsor=1",
|
| 19 |
+
"license": "BSD-2-Clause",
|
| 20 |
+
"author": "Felix Boehm <me@feedic.com>",
|
| 21 |
+
"sideEffects": false,
|
| 22 |
+
"type": "module",
|
| 23 |
+
"exports": {
|
| 24 |
+
".": {
|
| 25 |
+
"types": "./dist/index.d.ts",
|
| 26 |
+
"default": "./dist/index.js"
|
| 27 |
+
},
|
| 28 |
+
"./decode": {
|
| 29 |
+
"types": "./dist/decode.d.ts",
|
| 30 |
+
"default": "./dist/decode.js"
|
| 31 |
+
},
|
| 32 |
+
"./escape": {
|
| 33 |
+
"types": "./dist/escape.d.ts",
|
| 34 |
+
"default": "./dist/escape.js"
|
| 35 |
+
}
|
| 36 |
+
},
|
| 37 |
+
"main": "./dist/index.js",
|
| 38 |
+
"types": "./dist/index.d.ts",
|
| 39 |
+
"files": [
|
| 40 |
+
"dist",
|
| 41 |
+
"src",
|
| 42 |
+
"!**/*.spec.ts"
|
| 43 |
+
],
|
| 44 |
+
"scripts": {
|
| 45 |
+
"benchmark": "node --import=tsx scripts/benchmark.ts",
|
| 46 |
+
"build": "tsc",
|
| 47 |
+
"build:docs": "typedoc --hideGenerator src/index.ts",
|
| 48 |
+
"build:encode-trie": "node --import=tsx scripts/write-encode-map.ts",
|
| 49 |
+
"build:trie": "node --import=tsx scripts/write-decode-map.ts",
|
| 50 |
+
"format": "npm run format:es && npm run format:biome",
|
| 51 |
+
"format:biome": "biome check --fix .",
|
| 52 |
+
"format:es": "npm run lint:es -- --fix",
|
| 53 |
+
"lint": "npm run lint:es && npm run lint:ts && npm run lint:biome",
|
| 54 |
+
"lint:biome": "biome check .",
|
| 55 |
+
"lint:es": "eslint .",
|
| 56 |
+
"lint:ts": "tsc --noEmit",
|
| 57 |
+
"prepublishOnly": "npm run build",
|
| 58 |
+
"test": "npm run test:vi && npm run lint",
|
| 59 |
+
"test:vi": "vitest run"
|
| 60 |
+
},
|
| 61 |
+
"devDependencies": {
|
| 62 |
+
"@biomejs/biome": "^2.4.7",
|
| 63 |
+
"@eslint/compat": "^2.0.3",
|
| 64 |
+
"@feedic/eslint-config": "^0.3.1",
|
| 65 |
+
"@types/he": "^1.2.3",
|
| 66 |
+
"@types/node": "^25.5.0",
|
| 67 |
+
"eslint": "^10.0.3",
|
| 68 |
+
"eslint-config-biome": "^2.1.3",
|
| 69 |
+
"globals": "^17.4.0",
|
| 70 |
+
"he": "^1.2.0",
|
| 71 |
+
"html-entities": "^2.6.0",
|
| 72 |
+
"parse-entities": "^4.0.2",
|
| 73 |
+
"tinybench": "^6.0.0",
|
| 74 |
+
"tsx": "^4.21.0",
|
| 75 |
+
"typedoc": "^0.28.17",
|
| 76 |
+
"typescript": "^5.9.3",
|
| 77 |
+
"typescript-eslint": "^8.57.1",
|
| 78 |
+
"vitest": "^4.0.17"
|
| 79 |
+
},
|
| 80 |
+
"engines": {
|
| 81 |
+
"node": ">=20.19.0"
|
| 82 |
+
}
|
| 83 |
+
}
|
node_modules/entities/readme.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# entities [](https://npmjs.org/package/entities) [](https://npmjs.org/package/entities) [](https://github.com/fb55/entities/actions/workflows/nodejs-test.yml)
|
| 2 |
+
|
| 3 |
+
Encode & decode HTML & XML entities with ease & speed.
|
| 4 |
+
|
| 5 |
+
## Features
|
| 6 |
+
|
| 7 |
+
- 😇 Tried and true: `entities` is used by many popular libraries; eg.
|
| 8 |
+
[`htmlparser2`](https://github.com/fb55/htmlparser2), the official
|
| 9 |
+
[AWS SDK](https://github.com/aws/aws-sdk-js-v3) and
|
| 10 |
+
[`commonmark`](https://github.com/commonmark/commonmark.js) use it to process
|
| 11 |
+
HTML entities.
|
| 12 |
+
- ⚡️ Fast: `entities` is the fastest library for decoding HTML entities (as of
|
| 13 |
+
September 2025); see [performance](#performance).
|
| 14 |
+
- 🎛 Configurable: Get an output tailored for your needs. You are fine with
|
| 15 |
+
UTF8? That'll save you some bytes. Prefer to only have ASCII characters? We
|
| 16 |
+
can do that as well!
|
| 17 |
+
|
| 18 |
+
## How to…
|
| 19 |
+
|
| 20 |
+
### …install `entities`
|
| 21 |
+
|
| 22 |
+
npm install entities
|
| 23 |
+
|
| 24 |
+
### …use `entities`
|
| 25 |
+
|
| 26 |
+
```javascript
|
| 27 |
+
import * as entities from "entities";
|
| 28 |
+
|
| 29 |
+
// Encoding
|
| 30 |
+
entities.escapeUTF8("& ü"); // "&#38; ü"
|
| 31 |
+
entities.encodeXML("& ü"); // "&#38; ü"
|
| 32 |
+
entities.encodeHTML("& ü"); // "&#38; ü"
|
| 33 |
+
|
| 34 |
+
// Decoding
|
| 35 |
+
entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
| 36 |
+
entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Performance
|
| 40 |
+
|
| 41 |
+
Benchmarked in September 2025 with Node v24.6.0 on Apple M2 using `tinybench`.
|
| 42 |
+
Higher ops/s is better; `avg (μs)` is the mean time per operation.
|
| 43 |
+
See `scripts/benchmark.ts` to reproduce.
|
| 44 |
+
|
| 45 |
+
### Decoding
|
| 46 |
+
|
| 47 |
+
| Library | Version | ops/s | avg (μs) | ±% | slower |
|
| 48 |
+
| -------------- | ------- | --------- | -------- | ---- | ------ |
|
| 49 |
+
| entities | 7.0.0 | 5,838,416 | 175.57 | 0.06 | — |
|
| 50 |
+
| html-entities | 2.6.0 | 2,919,637 | 347.77 | 0.33 | 50.0% |
|
| 51 |
+
| he | 1.2.0 | 2,318,438 | 446.48 | 0.70 | 60.3% |
|
| 52 |
+
| parse-entities | 4.0.2 | 852,855 | 1,199.51 | 0.36 | 85.4% |
|
| 53 |
+
|
| 54 |
+
### Encoding
|
| 55 |
+
|
| 56 |
+
| Library | Version | ops/s | avg (μs) | ±% | slower |
|
| 57 |
+
| -------------- | ------- | --------- | -------- | ---- | ------ |
|
| 58 |
+
| entities | 7.0.0 | 2,770,115 | 368.09 | 0.11 | — |
|
| 59 |
+
| html-entities | 2.6.0 | 1,491,963 | 679.96 | 0.58 | 46.2% |
|
| 60 |
+
| he | 1.2.0 | 481,278 | 2,118.25 | 0.61 | 82.6% |
|
| 61 |
+
|
| 62 |
+
### Escaping
|
| 63 |
+
|
| 64 |
+
| Library | Version | ops/s | avg (μs) | ±% | slower |
|
| 65 |
+
| -------------- | ------- | --------- | -------- | ---- | ------ |
|
| 66 |
+
| entities | 7.0.0 | 4,616,468 | 223.84 | 0.17 | — |
|
| 67 |
+
| he | 1.2.0 | 3,659,301 | 280.76 | 0.58 | 20.7% |
|
| 68 |
+
| html-entities | 2.6.0 | 3,555,301 | 296.63 | 0.84 | 23.0% |
|
| 69 |
+
|
| 70 |
+
Note: Micro-benchmarks may vary across machines and Node versions.
|
| 71 |
+
|
| 72 |
+
---
|
| 73 |
+
|
| 74 |
+
## FAQ
|
| 75 |
+
|
| 76 |
+
> What methods should I actually use to encode my documents?
|
| 77 |
+
|
| 78 |
+
If your target supports UTF-8, the `escapeUTF8` method is going to be your best
|
| 79 |
+
choice. Otherwise, use either `encodeHTML` or `encodeXML` based on whether
|
| 80 |
+
you're dealing with an HTML or an XML document.
|
| 81 |
+
|
| 82 |
+
You can have a look at the options for the `encode` and `decode` methods to see
|
| 83 |
+
everything you can configure.
|
| 84 |
+
|
| 85 |
+
> When should I use strict decoding?
|
| 86 |
+
|
| 87 |
+
When strict decoding, entities not terminated with a semicolon will be ignored.
|
| 88 |
+
This is helpful for decoding entities in legacy environments.
|
| 89 |
+
|
| 90 |
+
> Why should I use `entities` instead of alternative modules?
|
| 91 |
+
|
| 92 |
+
As of September 2025, `entities` is faster than other modules. Still, this is
|
| 93 |
+
not a differentiated space and other modules can catch up.
|
| 94 |
+
|
| 95 |
+
**More importantly**, you might already have `entities` in your dependency graph
|
| 96 |
+
(as a dependency of eg. `cheerio`, or `htmlparser2`), and including it directly
|
| 97 |
+
might not even increase your bundle size. The same is true for other entity
|
| 98 |
+
libraries, so have a look through your `node_modules` directory!
|
| 99 |
+
|
| 100 |
+
> Does `entities` support tree shaking?
|
| 101 |
+
|
| 102 |
+
Yes! Note that for best results, you should not use the `encode` and `decode`
|
| 103 |
+
functions, as they wrap around a number of other functions, all of which will
|
| 104 |
+
remain in the bundle. Instead, use the functions that you need directly.
|
| 105 |
+
|
| 106 |
+
---
|
| 107 |
+
|
| 108 |
+
## Acknowledgements
|
| 109 |
+
|
| 110 |
+
This library wouldn't be possible without the work of these individuals. Thanks
|
| 111 |
+
to
|
| 112 |
+
|
| 113 |
+
- [@mathiasbynens](https://github.com/mathiasbynens) for his explanations about
|
| 114 |
+
character encodings, and his library `he`, which was one of the inspirations
|
| 115 |
+
for `entities`
|
| 116 |
+
- [@inikulin](https://github.com/inikulin) for his work on optimized tries for
|
| 117 |
+
decoding HTML entities for the `parse5` project
|
| 118 |
+
- [@mdevils](https://github.com/mdevils) for taking on the challenge of
|
| 119 |
+
producing a quick entity library with his `html-entities` library. `entities`
|
| 120 |
+
would be quite a bit slower if there wasn't any competition. Right now
|
| 121 |
+
`entities` is on top, but we'll see how long that lasts!
|
| 122 |
+
|
| 123 |
+
---
|
| 124 |
+
|
| 125 |
+
License: BSD-2-Clause
|
| 126 |
+
|
| 127 |
+
## Security contact information
|
| 128 |
+
|
| 129 |
+
To report a security vulnerability, please use the
|
| 130 |
+
[Tidelift security contact](https://tidelift.com/security). Tidelift will
|
| 131 |
+
coordinate the fix and disclosure.
|
node_modules/entities/src/decode-codepoint.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134
|
| 2 |
+
|
| 3 |
+
const decodeMap = new Map([
|
| 4 |
+
[0, 65_533],
|
| 5 |
+
// C1 Unicode control character reference replacements
|
| 6 |
+
[128, 8364],
|
| 7 |
+
[130, 8218],
|
| 8 |
+
[131, 402],
|
| 9 |
+
[132, 8222],
|
| 10 |
+
[133, 8230],
|
| 11 |
+
[134, 8224],
|
| 12 |
+
[135, 8225],
|
| 13 |
+
[136, 710],
|
| 14 |
+
[137, 8240],
|
| 15 |
+
[138, 352],
|
| 16 |
+
[139, 8249],
|
| 17 |
+
[140, 338],
|
| 18 |
+
[142, 381],
|
| 19 |
+
[145, 8216],
|
| 20 |
+
[146, 8217],
|
| 21 |
+
[147, 8220],
|
| 22 |
+
[148, 8221],
|
| 23 |
+
[149, 8226],
|
| 24 |
+
[150, 8211],
|
| 25 |
+
[151, 8212],
|
| 26 |
+
[152, 732],
|
| 27 |
+
[153, 8482],
|
| 28 |
+
[154, 353],
|
| 29 |
+
[155, 8250],
|
| 30 |
+
[156, 339],
|
| 31 |
+
[158, 382],
|
| 32 |
+
[159, 376],
|
| 33 |
+
]);
|
| 34 |
+
|
| 35 |
+
/**
|
| 36 |
+
* Replace the given code point with a replacement character if it is a
|
| 37 |
+
* surrogate or is outside the valid range. Otherwise return the code
|
| 38 |
+
* point unchanged.
|
| 39 |
+
* @param codePoint Unicode code point to convert.
|
| 40 |
+
*/
|
| 41 |
+
export function replaceCodePoint(codePoint: number): number {
|
| 42 |
+
if (
|
| 43 |
+
(codePoint >= 0xd8_00 && codePoint <= 0xdf_ff) ||
|
| 44 |
+
codePoint > 0x10_ff_ff
|
| 45 |
+
) {
|
| 46 |
+
return 0xff_fd;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
return decodeMap.get(codePoint) ?? codePoint;
|
| 50 |
+
}
|
node_modules/entities/src/decode.ts
ADDED
|
@@ -0,0 +1,671 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { replaceCodePoint } from "./decode-codepoint.js";
|
| 2 |
+
import { htmlDecodeTree } from "./generated/decode-data-html.js";
|
| 3 |
+
import { xmlDecodeTree } from "./generated/decode-data-xml.js";
|
| 4 |
+
import { BinTrieFlags } from "./internal/bin-trie-flags.js";
|
| 5 |
+
|
| 6 |
+
const enum CharCodes {
|
| 7 |
+
NUM = 35, // "#"
|
| 8 |
+
SEMI = 59, // ";"
|
| 9 |
+
EQUALS = 61, // "="
|
| 10 |
+
ZERO = 48, // "0"
|
| 11 |
+
NINE = 57, // "9"
|
| 12 |
+
LOWER_A = 97, // "a"
|
| 13 |
+
LOWER_F = 102, // "f"
|
| 14 |
+
LOWER_X = 120, // "x"
|
| 15 |
+
LOWER_Z = 122, // "z"
|
| 16 |
+
UPPER_A = 65, // "A"
|
| 17 |
+
UPPER_F = 70, // "F"
|
| 18 |
+
UPPER_Z = 90, // "Z"
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
/** Bit that needs to be set to convert an upper case ASCII character to lower case */
|
| 22 |
+
const TO_LOWER_BIT = 0b10_0000;
|
| 23 |
+
|
| 24 |
+
function isNumber(code: number): boolean {
|
| 25 |
+
return code >= CharCodes.ZERO && code <= CharCodes.NINE;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
function isHexadecimalCharacter(code: number): boolean {
|
| 29 |
+
return (
|
| 30 |
+
(code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F) ||
|
| 31 |
+
(code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F)
|
| 32 |
+
);
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
function isAsciiAlphaNumeric(code: number): boolean {
|
| 36 |
+
return (
|
| 37 |
+
(code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z) ||
|
| 38 |
+
(code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z) ||
|
| 39 |
+
isNumber(code)
|
| 40 |
+
);
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* Checks if the given character is a valid end character for an entity in an attribute.
|
| 45 |
+
*
|
| 46 |
+
* Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.
|
| 47 |
+
* See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
|
| 48 |
+
* @param code Code point to decode.
|
| 49 |
+
*/
|
| 50 |
+
function isEntityInAttributeInvalidEnd(code: number): boolean {
|
| 51 |
+
return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
const enum EntityDecoderState {
|
| 55 |
+
EntityStart,
|
| 56 |
+
NumericStart,
|
| 57 |
+
NumericDecimal,
|
| 58 |
+
NumericHex,
|
| 59 |
+
NamedEntity,
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* Decoding mode for named entities.
|
| 64 |
+
*/
|
| 65 |
+
export enum DecodingMode {
|
| 66 |
+
/** Entities in text nodes that can end with any character. */
|
| 67 |
+
Legacy = 0,
|
| 68 |
+
/** Only allow entities terminated with a semicolon. */
|
| 69 |
+
Strict = 1,
|
| 70 |
+
/** Entities in attributes have limitations on ending characters. */
|
| 71 |
+
Attribute = 2,
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
/**
|
| 75 |
+
* Producers for character reference errors as defined in the HTML spec.
|
| 76 |
+
*/
|
| 77 |
+
export interface EntityErrorProducer {
|
| 78 |
+
missingSemicolonAfterCharacterReference(): void;
|
| 79 |
+
absenceOfDigitsInNumericCharacterReference(
|
| 80 |
+
consumedCharacters: number,
|
| 81 |
+
): void;
|
| 82 |
+
validateNumericCharacterReference(code: number): void;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
/**
|
| 86 |
+
* Token decoder with support of writing partial entities.
|
| 87 |
+
*/
|
| 88 |
+
export class EntityDecoder {
|
| 89 |
+
constructor(
|
| 90 |
+
/** The tree used to decode entities. */
|
| 91 |
+
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: False positive
|
| 92 |
+
private readonly decodeTree: Uint16Array,
|
| 93 |
+
/**
|
| 94 |
+
* The function that is called when a codepoint is decoded.
|
| 95 |
+
*
|
| 96 |
+
* For multi-byte named entities, this will be called multiple times,
|
| 97 |
+
* with the second codepoint, and the same `consumed` value.
|
| 98 |
+
* @param codepoint The decoded codepoint.
|
| 99 |
+
* @param consumed The number of bytes consumed by the decoder.
|
| 100 |
+
*/
|
| 101 |
+
private readonly emitCodePoint: (cp: number, consumed: number) => void,
|
| 102 |
+
/** An object that is used to produce errors. */
|
| 103 |
+
private readonly errors?: EntityErrorProducer | undefined,
|
| 104 |
+
) {}
|
| 105 |
+
|
| 106 |
+
/** The current state of the decoder. */
|
| 107 |
+
private state = EntityDecoderState.EntityStart;
|
| 108 |
+
/** Characters that were consumed while parsing an entity. */
|
| 109 |
+
private consumed = 1;
|
| 110 |
+
/**
|
| 111 |
+
* The result of the entity.
|
| 112 |
+
*
|
| 113 |
+
* Either the result index of a numeric entity, or the codepoint of a
|
| 114 |
+
* numeric entity.
|
| 115 |
+
*/
|
| 116 |
+
private result = 0;
|
| 117 |
+
|
| 118 |
+
/** The current index in the decode tree. */
|
| 119 |
+
private treeIndex = 0;
|
| 120 |
+
/** The number of characters that were consumed in excess. */
|
| 121 |
+
private excess = 1;
|
| 122 |
+
/** The mode in which the decoder is operating. */
|
| 123 |
+
private decodeMode = DecodingMode.Strict;
|
| 124 |
+
/** The number of characters that have been consumed in the current run. */
|
| 125 |
+
private runConsumed = 0;
|
| 126 |
+
|
| 127 |
+
/**
|
| 128 |
+
* Resets the instance to make it reusable.
|
| 129 |
+
* @param decodeMode Entity decoding mode to use.
|
| 130 |
+
*/
|
| 131 |
+
startEntity(decodeMode: DecodingMode): void {
|
| 132 |
+
this.decodeMode = decodeMode;
|
| 133 |
+
this.state = EntityDecoderState.EntityStart;
|
| 134 |
+
this.result = 0;
|
| 135 |
+
this.treeIndex = 0;
|
| 136 |
+
this.excess = 1;
|
| 137 |
+
this.consumed = 1;
|
| 138 |
+
this.runConsumed = 0;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
/**
|
| 142 |
+
* Write an entity to the decoder. This can be called multiple times with partial entities.
|
| 143 |
+
* If the entity is incomplete, the decoder will return -1.
|
| 144 |
+
*
|
| 145 |
+
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
|
| 146 |
+
* entity is incomplete, and resume when the next string is written.
|
| 147 |
+
* @param input The string containing the entity (or a continuation of the entity).
|
| 148 |
+
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
|
| 149 |
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
| 150 |
+
*/
|
| 151 |
+
write(input: string, offset: number): number {
|
| 152 |
+
switch (this.state) {
|
| 153 |
+
case EntityDecoderState.EntityStart: {
|
| 154 |
+
if (input.charCodeAt(offset) === CharCodes.NUM) {
|
| 155 |
+
this.state = EntityDecoderState.NumericStart;
|
| 156 |
+
this.consumed += 1;
|
| 157 |
+
return this.stateNumericStart(input, offset + 1);
|
| 158 |
+
}
|
| 159 |
+
this.state = EntityDecoderState.NamedEntity;
|
| 160 |
+
return this.stateNamedEntity(input, offset);
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
case EntityDecoderState.NumericStart: {
|
| 164 |
+
return this.stateNumericStart(input, offset);
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
case EntityDecoderState.NumericDecimal: {
|
| 168 |
+
return this.stateNumericDecimal(input, offset);
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
case EntityDecoderState.NumericHex: {
|
| 172 |
+
return this.stateNumericHex(input, offset);
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
case EntityDecoderState.NamedEntity: {
|
| 176 |
+
return this.stateNamedEntity(input, offset);
|
| 177 |
+
}
|
| 178 |
+
}
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
/**
|
| 182 |
+
* Switches between the numeric decimal and hexadecimal states.
|
| 183 |
+
*
|
| 184 |
+
* Equivalent to the `Numeric character reference state` in the HTML spec.
|
| 185 |
+
* @param input The string containing the entity (or a continuation of the entity).
|
| 186 |
+
* @param offset The current offset.
|
| 187 |
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
| 188 |
+
*/
|
| 189 |
+
private stateNumericStart(input: string, offset: number): number {
|
| 190 |
+
if (offset >= input.length) {
|
| 191 |
+
return -1;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
|
| 195 |
+
this.state = EntityDecoderState.NumericHex;
|
| 196 |
+
this.consumed += 1;
|
| 197 |
+
return this.stateNumericHex(input, offset + 1);
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
this.state = EntityDecoderState.NumericDecimal;
|
| 201 |
+
return this.stateNumericDecimal(input, offset);
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
/**
|
| 205 |
+
* Parses a hexadecimal numeric entity.
|
| 206 |
+
*
|
| 207 |
+
* Equivalent to the `Hexademical character reference state` in the HTML spec.
|
| 208 |
+
* @param input The string containing the entity (or a continuation of the entity).
|
| 209 |
+
* @param offset The current offset.
|
| 210 |
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
| 211 |
+
*/
|
| 212 |
+
private stateNumericHex(input: string, offset: number): number {
|
| 213 |
+
while (offset < input.length) {
|
| 214 |
+
const char = input.charCodeAt(offset);
|
| 215 |
+
if (isNumber(char) || isHexadecimalCharacter(char)) {
|
| 216 |
+
// Convert hex digit to value (0-15); 'a'/'A' -> 10.
|
| 217 |
+
const digit =
|
| 218 |
+
char <= CharCodes.NINE
|
| 219 |
+
? char - CharCodes.ZERO
|
| 220 |
+
: (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;
|
| 221 |
+
this.result = this.result * 16 + digit;
|
| 222 |
+
this.consumed++;
|
| 223 |
+
offset++;
|
| 224 |
+
} else {
|
| 225 |
+
return this.emitNumericEntity(char, 3);
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
return -1; // Incomplete entity
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
/**
|
| 232 |
+
* Parses a decimal numeric entity.
|
| 233 |
+
*
|
| 234 |
+
* Equivalent to the `Decimal character reference state` in the HTML spec.
|
| 235 |
+
* @param input The string containing the entity (or a continuation of the entity).
|
| 236 |
+
* @param offset The current offset.
|
| 237 |
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
| 238 |
+
*/
|
| 239 |
+
private stateNumericDecimal(input: string, offset: number): number {
|
| 240 |
+
while (offset < input.length) {
|
| 241 |
+
const char = input.charCodeAt(offset);
|
| 242 |
+
if (isNumber(char)) {
|
| 243 |
+
this.result = this.result * 10 + (char - CharCodes.ZERO);
|
| 244 |
+
this.consumed++;
|
| 245 |
+
offset++;
|
| 246 |
+
} else {
|
| 247 |
+
return this.emitNumericEntity(char, 2);
|
| 248 |
+
}
|
| 249 |
+
}
|
| 250 |
+
return -1; // Incomplete entity
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
/**
|
| 254 |
+
* Validate and emit a numeric entity.
|
| 255 |
+
*
|
| 256 |
+
* Implements the logic from the `Hexademical character reference start
|
| 257 |
+
* state` and `Numeric character reference end state` in the HTML spec.
|
| 258 |
+
* @param lastCp The last code point of the entity. Used to see if the
|
| 259 |
+
* entity was terminated with a semicolon.
|
| 260 |
+
* @param expectedLength The minimum number of characters that should be
|
| 261 |
+
* consumed. Used to validate that at least one digit
|
| 262 |
+
* was consumed.
|
| 263 |
+
* @returns The number of characters that were consumed.
|
| 264 |
+
*/
|
| 265 |
+
private emitNumericEntity(lastCp: number, expectedLength: number): number {
|
| 266 |
+
// Ensure we consumed at least one digit.
|
| 267 |
+
if (this.consumed <= expectedLength) {
|
| 268 |
+
this.errors?.absenceOfDigitsInNumericCharacterReference(
|
| 269 |
+
this.consumed,
|
| 270 |
+
);
|
| 271 |
+
return 0;
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
// Figure out if this is a legit end of the entity
|
| 275 |
+
if (lastCp === CharCodes.SEMI) {
|
| 276 |
+
this.consumed += 1;
|
| 277 |
+
} else if (this.decodeMode === DecodingMode.Strict) {
|
| 278 |
+
return 0;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
|
| 282 |
+
|
| 283 |
+
if (this.errors) {
|
| 284 |
+
if (lastCp !== CharCodes.SEMI) {
|
| 285 |
+
this.errors.missingSemicolonAfterCharacterReference();
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
this.errors.validateNumericCharacterReference(this.result);
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
return this.consumed;
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
/**
|
| 295 |
+
* Parses a named entity.
|
| 296 |
+
*
|
| 297 |
+
* Equivalent to the `Named character reference state` in the HTML spec.
|
| 298 |
+
* @param input The string containing the entity (or a continuation of the entity).
|
| 299 |
+
* @param offset The current offset.
|
| 300 |
+
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
|
| 301 |
+
*/
|
| 302 |
+
private stateNamedEntity(input: string, offset: number): number {
|
| 303 |
+
const { decodeTree } = this;
|
| 304 |
+
let current = decodeTree[this.treeIndex];
|
| 305 |
+
// The length is the number of bytes of the value, including the current byte.
|
| 306 |
+
let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
| 307 |
+
|
| 308 |
+
while (offset < input.length) {
|
| 309 |
+
// Handle compact runs (possibly inline): valueLength == 0 and SEMI_REQUIRED bit set.
|
| 310 |
+
if (valueLength === 0 && (current & BinTrieFlags.FLAG13) !== 0) {
|
| 311 |
+
const runLength =
|
| 312 |
+
(current & BinTrieFlags.BRANCH_LENGTH) >> 7; /* 2..63 */
|
| 313 |
+
|
| 314 |
+
// If we are starting a run, check the first char.
|
| 315 |
+
if (this.runConsumed === 0) {
|
| 316 |
+
const firstChar = current & BinTrieFlags.JUMP_TABLE;
|
| 317 |
+
if (input.charCodeAt(offset) !== firstChar) {
|
| 318 |
+
return this.result === 0
|
| 319 |
+
? 0
|
| 320 |
+
: this.emitNotTerminatedNamedEntity();
|
| 321 |
+
}
|
| 322 |
+
offset++;
|
| 323 |
+
this.excess++;
|
| 324 |
+
this.runConsumed++;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
// Check remaining characters in the run.
|
| 328 |
+
while (this.runConsumed < runLength) {
|
| 329 |
+
if (offset >= input.length) {
|
| 330 |
+
return -1;
|
| 331 |
+
}
|
| 332 |
+
|
| 333 |
+
const charIndexInPacked = this.runConsumed - 1;
|
| 334 |
+
const packedWord =
|
| 335 |
+
decodeTree[
|
| 336 |
+
this.treeIndex + 1 + (charIndexInPacked >> 1)
|
| 337 |
+
];
|
| 338 |
+
const expectedChar =
|
| 339 |
+
charIndexInPacked % 2 === 0
|
| 340 |
+
? packedWord & 0xff
|
| 341 |
+
: (packedWord >> 8) & 0xff;
|
| 342 |
+
|
| 343 |
+
if (input.charCodeAt(offset) !== expectedChar) {
|
| 344 |
+
this.runConsumed = 0;
|
| 345 |
+
return this.result === 0
|
| 346 |
+
? 0
|
| 347 |
+
: this.emitNotTerminatedNamedEntity();
|
| 348 |
+
}
|
| 349 |
+
offset++;
|
| 350 |
+
this.excess++;
|
| 351 |
+
this.runConsumed++;
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
this.runConsumed = 0;
|
| 355 |
+
this.treeIndex += 1 + (runLength >> 1);
|
| 356 |
+
current = decodeTree[this.treeIndex];
|
| 357 |
+
valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
if (offset >= input.length) break;
|
| 361 |
+
|
| 362 |
+
const char = input.charCodeAt(offset);
|
| 363 |
+
|
| 364 |
+
/*
|
| 365 |
+
* Implicit semicolon handling for nodes that require a semicolon but
|
| 366 |
+
* don't have an explicit ';' branch stored in the trie. If we have
|
| 367 |
+
* a value on the current node, it requires a semicolon, and the
|
| 368 |
+
* current input character is a semicolon, emit the entity using the
|
| 369 |
+
* current node (without descending further).
|
| 370 |
+
*/
|
| 371 |
+
if (
|
| 372 |
+
char === CharCodes.SEMI &&
|
| 373 |
+
valueLength !== 0 &&
|
| 374 |
+
(current & BinTrieFlags.FLAG13) !== 0
|
| 375 |
+
) {
|
| 376 |
+
return this.emitNamedEntityData(
|
| 377 |
+
this.treeIndex,
|
| 378 |
+
valueLength,
|
| 379 |
+
this.consumed + this.excess,
|
| 380 |
+
);
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
this.treeIndex = determineBranch(
|
| 384 |
+
decodeTree,
|
| 385 |
+
current,
|
| 386 |
+
this.treeIndex + Math.max(1, valueLength),
|
| 387 |
+
char,
|
| 388 |
+
);
|
| 389 |
+
|
| 390 |
+
if (this.treeIndex < 0) {
|
| 391 |
+
return this.result === 0 ||
|
| 392 |
+
// If we are parsing an attribute
|
| 393 |
+
(this.decodeMode === DecodingMode.Attribute &&
|
| 394 |
+
// We shouldn't have consumed any characters after the entity,
|
| 395 |
+
(valueLength === 0 ||
|
| 396 |
+
// And there should be no invalid characters.
|
| 397 |
+
isEntityInAttributeInvalidEnd(char)))
|
| 398 |
+
? 0
|
| 399 |
+
: this.emitNotTerminatedNamedEntity();
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
current = decodeTree[this.treeIndex];
|
| 403 |
+
valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
|
| 404 |
+
|
| 405 |
+
// If the branch is a value, store it and continue
|
| 406 |
+
if (valueLength !== 0) {
|
| 407 |
+
// If the entity is terminated by a semicolon, we are done.
|
| 408 |
+
if (char === CharCodes.SEMI) {
|
| 409 |
+
return this.emitNamedEntityData(
|
| 410 |
+
this.treeIndex,
|
| 411 |
+
valueLength,
|
| 412 |
+
this.consumed + this.excess,
|
| 413 |
+
);
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
// If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.
|
| 417 |
+
if (
|
| 418 |
+
this.decodeMode !== DecodingMode.Strict &&
|
| 419 |
+
(current & BinTrieFlags.FLAG13) === 0
|
| 420 |
+
) {
|
| 421 |
+
this.result = this.treeIndex;
|
| 422 |
+
this.consumed += this.excess;
|
| 423 |
+
this.excess = 0;
|
| 424 |
+
}
|
| 425 |
+
}
|
| 426 |
+
// Increment offset & excess for next iteration
|
| 427 |
+
offset++;
|
| 428 |
+
this.excess++;
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
return -1;
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
/**
|
| 435 |
+
* Emit a named entity that was not terminated with a semicolon.
|
| 436 |
+
* @returns The number of characters consumed.
|
| 437 |
+
*/
|
| 438 |
+
private emitNotTerminatedNamedEntity(): number {
|
| 439 |
+
const { result, decodeTree } = this;
|
| 440 |
+
|
| 441 |
+
const valueLength =
|
| 442 |
+
(decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
|
| 443 |
+
|
| 444 |
+
this.emitNamedEntityData(result, valueLength, this.consumed);
|
| 445 |
+
this.errors?.missingSemicolonAfterCharacterReference();
|
| 446 |
+
|
| 447 |
+
return this.consumed;
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
/**
|
| 451 |
+
* Emit a named entity.
|
| 452 |
+
* @param result The index of the entity in the decode tree.
|
| 453 |
+
* @param valueLength The number of bytes in the entity.
|
| 454 |
+
* @param consumed The number of characters consumed.
|
| 455 |
+
* @returns The number of characters consumed.
|
| 456 |
+
*/
|
| 457 |
+
private emitNamedEntityData(
|
| 458 |
+
result: number,
|
| 459 |
+
valueLength: number,
|
| 460 |
+
consumed: number,
|
| 461 |
+
): number {
|
| 462 |
+
const { decodeTree } = this;
|
| 463 |
+
|
| 464 |
+
this.emitCodePoint(
|
| 465 |
+
valueLength === 1
|
| 466 |
+
? decodeTree[result] &
|
| 467 |
+
~(BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)
|
| 468 |
+
: decodeTree[result + 1],
|
| 469 |
+
consumed,
|
| 470 |
+
);
|
| 471 |
+
if (valueLength === 3) {
|
| 472 |
+
// For multi-byte values, we need to emit the second byte.
|
| 473 |
+
this.emitCodePoint(decodeTree[result + 2], consumed);
|
| 474 |
+
}
|
| 475 |
+
|
| 476 |
+
return consumed;
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
/**
|
| 480 |
+
* Signal to the parser that the end of the input was reached.
|
| 481 |
+
*
|
| 482 |
+
* Remaining data will be emitted and relevant errors will be produced.
|
| 483 |
+
* @returns The number of characters consumed.
|
| 484 |
+
*/
|
| 485 |
+
end(): number {
|
| 486 |
+
switch (this.state) {
|
| 487 |
+
case EntityDecoderState.NamedEntity: {
|
| 488 |
+
// Emit a named entity if we have one.
|
| 489 |
+
return this.result !== 0 &&
|
| 490 |
+
(this.decodeMode !== DecodingMode.Attribute ||
|
| 491 |
+
this.result === this.treeIndex)
|
| 492 |
+
? this.emitNotTerminatedNamedEntity()
|
| 493 |
+
: 0;
|
| 494 |
+
}
|
| 495 |
+
// Otherwise, emit a numeric entity if we have one.
|
| 496 |
+
case EntityDecoderState.NumericDecimal: {
|
| 497 |
+
return this.emitNumericEntity(0, 2);
|
| 498 |
+
}
|
| 499 |
+
case EntityDecoderState.NumericHex: {
|
| 500 |
+
return this.emitNumericEntity(0, 3);
|
| 501 |
+
}
|
| 502 |
+
case EntityDecoderState.NumericStart: {
|
| 503 |
+
this.errors?.absenceOfDigitsInNumericCharacterReference(
|
| 504 |
+
this.consumed,
|
| 505 |
+
);
|
| 506 |
+
return 0;
|
| 507 |
+
}
|
| 508 |
+
case EntityDecoderState.EntityStart: {
|
| 509 |
+
// Return 0 if we have no entity.
|
| 510 |
+
return 0;
|
| 511 |
+
}
|
| 512 |
+
}
|
| 513 |
+
}
|
| 514 |
+
}
|
| 515 |
+
|
| 516 |
+
/**
|
| 517 |
+
* Creates a function that decodes entities in a string.
|
| 518 |
+
* @param decodeTree The decode tree.
|
| 519 |
+
* @returns A function that decodes entities in a string.
|
| 520 |
+
*/
|
| 521 |
+
function getDecoder(decodeTree: Uint16Array) {
|
| 522 |
+
let returnValue = "";
|
| 523 |
+
const decoder = new EntityDecoder(
|
| 524 |
+
decodeTree,
|
| 525 |
+
(data) => (returnValue += String.fromCodePoint(data)),
|
| 526 |
+
);
|
| 527 |
+
|
| 528 |
+
return function decodeWithTrie(
|
| 529 |
+
input: string,
|
| 530 |
+
decodeMode: DecodingMode,
|
| 531 |
+
): string {
|
| 532 |
+
let lastIndex = 0;
|
| 533 |
+
let offset = 0;
|
| 534 |
+
|
| 535 |
+
while ((offset = input.indexOf("&", offset)) >= 0) {
|
| 536 |
+
returnValue += input.slice(lastIndex, offset);
|
| 537 |
+
|
| 538 |
+
decoder.startEntity(decodeMode);
|
| 539 |
+
|
| 540 |
+
const length = decoder.write(
|
| 541 |
+
input,
|
| 542 |
+
// Skip the "&"
|
| 543 |
+
offset + 1,
|
| 544 |
+
);
|
| 545 |
+
|
| 546 |
+
if (length < 0) {
|
| 547 |
+
lastIndex = offset + decoder.end();
|
| 548 |
+
break;
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
lastIndex = offset + length;
|
| 552 |
+
// If `length` is 0, skip the current `&` and continue.
|
| 553 |
+
offset = length === 0 ? lastIndex + 1 : lastIndex;
|
| 554 |
+
}
|
| 555 |
+
|
| 556 |
+
const result = returnValue + input.slice(lastIndex);
|
| 557 |
+
|
| 558 |
+
// Make sure we don't keep a reference to the final string.
|
| 559 |
+
returnValue = "";
|
| 560 |
+
|
| 561 |
+
return result;
|
| 562 |
+
};
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
/**
|
| 566 |
+
* Determines the branch of the current node that is taken given the current
|
| 567 |
+
* character. This function is used to traverse the trie.
|
| 568 |
+
* @param decodeTree The trie.
|
| 569 |
+
* @param current The current node.
|
| 570 |
+
* @param nodeIndex Index immediately after the current node header.
|
| 571 |
+
* @param char The current character.
|
| 572 |
+
* @returns The index of the next node, or -1 if no branch is taken.
|
| 573 |
+
*/
|
| 574 |
+
export function determineBranch(
|
| 575 |
+
decodeTree: Uint16Array,
|
| 576 |
+
current: number,
|
| 577 |
+
nodeIndex: number,
|
| 578 |
+
char: number,
|
| 579 |
+
): number {
|
| 580 |
+
const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
|
| 581 |
+
const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
|
| 582 |
+
|
| 583 |
+
// Case 1: Single branch encoded in jump offset
|
| 584 |
+
if (branchCount === 0) {
|
| 585 |
+
return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
// Case 2: Multiple branches encoded in jump table
|
| 589 |
+
if (jumpOffset) {
|
| 590 |
+
const value = char - jumpOffset;
|
| 591 |
+
|
| 592 |
+
return value < 0 || value >= branchCount
|
| 593 |
+
? -1
|
| 594 |
+
: decodeTree[nodeIndex + value] - 1;
|
| 595 |
+
}
|
| 596 |
+
|
| 597 |
+
// Case 3: Multiple branches encoded in packed dictionary (two keys per uint16)
|
| 598 |
+
const packedKeySlots = (branchCount + 1) >> 1;
|
| 599 |
+
|
| 600 |
+
/*
|
| 601 |
+
* Treat packed keys as a virtual sorted array of length `branchCount`.
|
| 602 |
+
* Key(i) = low byte for even i, high byte for odd i in slot i>>1.
|
| 603 |
+
*/
|
| 604 |
+
let lo = 0;
|
| 605 |
+
let hi = branchCount - 1;
|
| 606 |
+
|
| 607 |
+
while (lo <= hi) {
|
| 608 |
+
const mid = (lo + hi) >>> 1;
|
| 609 |
+
const slot = mid >> 1;
|
| 610 |
+
const packed = decodeTree[nodeIndex + slot];
|
| 611 |
+
const midKey = (packed >> ((mid & 1) * 8)) & 0xff;
|
| 612 |
+
|
| 613 |
+
if (midKey < char) {
|
| 614 |
+
lo = mid + 1;
|
| 615 |
+
} else if (midKey > char) {
|
| 616 |
+
hi = mid - 1;
|
| 617 |
+
} else {
|
| 618 |
+
return decodeTree[nodeIndex + packedKeySlots + mid];
|
| 619 |
+
}
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
return -1;
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
+
const htmlDecoder = /* #__PURE__ */ getDecoder(htmlDecodeTree);
|
| 626 |
+
const xmlDecoder = /* #__PURE__ */ getDecoder(xmlDecodeTree);
|
| 627 |
+
|
| 628 |
+
/**
|
| 629 |
+
* Decodes an HTML string.
|
| 630 |
+
* @param htmlString The string to decode.
|
| 631 |
+
* @param mode The decoding mode.
|
| 632 |
+
* @returns The decoded string.
|
| 633 |
+
*/
|
| 634 |
+
export function decodeHTML(
|
| 635 |
+
htmlString: string,
|
| 636 |
+
mode: DecodingMode = DecodingMode.Legacy,
|
| 637 |
+
): string {
|
| 638 |
+
return htmlDecoder(htmlString, mode);
|
| 639 |
+
}
|
| 640 |
+
|
| 641 |
+
/**
|
| 642 |
+
* Decodes an HTML string in an attribute.
|
| 643 |
+
* @param htmlAttribute The string to decode.
|
| 644 |
+
* @returns The decoded string.
|
| 645 |
+
*/
|
| 646 |
+
export function decodeHTMLAttribute(htmlAttribute: string): string {
|
| 647 |
+
return htmlDecoder(htmlAttribute, DecodingMode.Attribute);
|
| 648 |
+
}
|
| 649 |
+
|
| 650 |
+
/**
|
| 651 |
+
* Decodes an HTML string, requiring all entities to be terminated by a semicolon.
|
| 652 |
+
* @param htmlString The string to decode.
|
| 653 |
+
* @returns The decoded string.
|
| 654 |
+
*/
|
| 655 |
+
export function decodeHTMLStrict(htmlString: string): string {
|
| 656 |
+
return htmlDecoder(htmlString, DecodingMode.Strict);
|
| 657 |
+
}
|
| 658 |
+
|
| 659 |
+
/**
|
| 660 |
+
* Decodes an XML string, requiring all entities to be terminated by a semicolon.
|
| 661 |
+
* @param xmlString The string to decode.
|
| 662 |
+
* @returns The decoded string.
|
| 663 |
+
*/
|
| 664 |
+
export function decodeXML(xmlString: string): string {
|
| 665 |
+
return xmlDecoder(xmlString, DecodingMode.Strict);
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
export { replaceCodePoint } from "./decode-codepoint.js";
|
| 669 |
+
// Re-export for use by eg. htmlparser2
|
| 670 |
+
export { htmlDecodeTree } from "./generated/decode-data-html.js";
|
| 671 |
+
export { xmlDecodeTree } from "./generated/decode-data-xml.js";
|
node_modules/entities/src/encode.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { getCodePoint, XML_BITSET_VALUE } from "./escape.js";
|
| 2 |
+
import { htmlTrie } from "./generated/encode-html.js";
|
| 3 |
+
|
| 4 |
+
/**
|
| 5 |
+
* We store the characters to consider as a compact bitset for fast lookups.
|
| 6 |
+
*/
|
| 7 |
+
const HTML_BITSET = /* #__PURE__ */ new Uint32Array([
|
| 8 |
+
0x16_00, // Bits for 09,0A,0C
|
| 9 |
+
0xfc_00_ff_fe, // 32..63 -> 21-2D (minus space), 2E,2F,3A-3F
|
| 10 |
+
0xf8_00_00_01, // 64..95 -> 40, 5B-5F
|
| 11 |
+
0x38_00_00_01, // 96..127-> 60, 7B-7D
|
| 12 |
+
]);
|
| 13 |
+
|
| 14 |
+
const XML_BITSET = /* #__PURE__ */ new Uint32Array([0, XML_BITSET_VALUE, 0, 0]);
|
| 15 |
+
|
| 16 |
+
/**
|
| 17 |
+
* Encodes all characters in the input using HTML entities. This includes
|
| 18 |
+
* characters that are valid ASCII characters in HTML documents, such as `#`.
|
| 19 |
+
*
|
| 20 |
+
* To get a more compact output, consider using the `encodeNonAsciiHTML`
|
| 21 |
+
* function, which will only encode characters that are not valid in HTML
|
| 22 |
+
* documents, as well as non-ASCII characters.
|
| 23 |
+
*
|
| 24 |
+
* If a character has no equivalent entity, a numeric hexadecimal reference
|
| 25 |
+
* (eg. `ü`) will be used.
|
| 26 |
+
* @param input Input string to encode or decode.
|
| 27 |
+
*/
|
| 28 |
+
export function encodeHTML(input: string): string {
|
| 29 |
+
return encodeHTMLTrieRe(HTML_BITSET, input);
|
| 30 |
+
}
|
| 31 |
+
/**
|
| 32 |
+
* Encodes all non-ASCII characters, as well as characters not valid in HTML
|
| 33 |
+
* documents using HTML entities. This function will not encode characters that
|
| 34 |
+
* are valid in HTML documents, such as `#`.
|
| 35 |
+
*
|
| 36 |
+
* If a character has no equivalent entity, a numeric hexadecimal reference
|
| 37 |
+
* (eg. `ü`) will be used.
|
| 38 |
+
* @param input Input string to encode or decode.
|
| 39 |
+
*/
|
| 40 |
+
export function encodeNonAsciiHTML(input: string): string {
|
| 41 |
+
return encodeHTMLTrieRe(XML_BITSET, input);
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
function encodeHTMLTrieRe(bitset: Uint32Array, input: string): string {
|
| 45 |
+
let out: string | undefined;
|
| 46 |
+
let last = 0; // Start of the next untouched slice.
|
| 47 |
+
const { length } = input;
|
| 48 |
+
|
| 49 |
+
for (let index = 0; index < length; index++) {
|
| 50 |
+
const char = input.charCodeAt(index);
|
| 51 |
+
// Skip ASCII characters that don't need encoding
|
| 52 |
+
if (char < 0x80 && !((bitset[char >>> 5] >>> char) & 1)) {
|
| 53 |
+
continue;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
if (out === undefined) out = input.substring(0, index);
|
| 57 |
+
else if (last !== index) out += input.substring(last, index);
|
| 58 |
+
|
| 59 |
+
let node = htmlTrie.get(char);
|
| 60 |
+
|
| 61 |
+
if (typeof node === "object") {
|
| 62 |
+
if (index + 1 < length) {
|
| 63 |
+
const nextChar = input.charCodeAt(index + 1);
|
| 64 |
+
const value =
|
| 65 |
+
typeof node.next === "number"
|
| 66 |
+
? node.next === nextChar
|
| 67 |
+
? node.nextValue
|
| 68 |
+
: undefined
|
| 69 |
+
: node.next.get(nextChar);
|
| 70 |
+
|
| 71 |
+
if (value !== undefined) {
|
| 72 |
+
out += value;
|
| 73 |
+
index++;
|
| 74 |
+
last = index + 1;
|
| 75 |
+
continue;
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
node = node.value;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
if (node === undefined) {
|
| 82 |
+
const cp = getCodePoint(input, index);
|
| 83 |
+
out += `&#x${cp.toString(16)};`;
|
| 84 |
+
if (cp !== char) index++;
|
| 85 |
+
last = index + 1;
|
| 86 |
+
} else {
|
| 87 |
+
out += node;
|
| 88 |
+
last = index + 1;
|
| 89 |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const xmlCodeMap = new Map([
|
| 2 |
+
[34, """],
|
| 3 |
+
[38, "&"],
|
| 4 |
+
[39, "'"],
|
| 5 |
+
[60, "<"],
|
| 6 |
+
[62, ">"],
|
| 7 |
+
]);
|
| 8 |
+
|
| 9 |
+
// For compatibility with node < 4, we wrap `codePointAt`
|
| 10 |
+
/**
|
| 11 |
+
* Read a code point at a given index.
|
| 12 |
+
* @param input Input string to encode or decode.
|
| 13 |
+
* @param index Current read position in the input string.
|
| 14 |
+
*/
|
| 15 |
+
export const getCodePoint: (c: string, index: number) => number =
|
| 16 |
+
typeof String.prototype.codePointAt === "function"
|
| 17 |
+
? (input: string, index: number): number => input.codePointAt(index)!
|
| 18 |
+
: // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
| 19 |
+
(c: string, index: number): number =>
|
| 20 |
+
(c.charCodeAt(index) & 0xfc_00) === 0xd8_00
|
| 21 |
+
? (c.charCodeAt(index) - 0xd8_00) * 0x4_00 +
|
| 22 |
+
c.charCodeAt(index + 1) -
|
| 23 |
+
0xdc_00 +
|
| 24 |
+
0x1_00_00
|
| 25 |
+
: c.charCodeAt(index);
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* Bitset for ASCII characters that need to be escaped in XML.
|
| 29 |
+
*/
|
| 30 |
+
export const XML_BITSET_VALUE = 0x50_00_00_c4; // 32..63 -> 34 ("),38 (&),39 ('),60 (<),62 (>)
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
| 34 |
+
* documents using XML entities. Uses a fast bitset scan instead of RegExp.
|
| 35 |
+
*
|
| 36 |
+
* If a character has no equivalent entity, a numeric hexadecimal reference
|
| 37 |
+
* (eg. `ü`) will be used.
|
| 38 |
+
* @param input Input string to encode or decode.
|
| 39 |
+
*/
|
| 40 |
+
export function encodeXML(input: string): string {
|
| 41 |
+
let out: string | undefined;
|
| 42 |
+
let last = 0;
|
| 43 |
+
const { length } = input;
|
| 44 |
+
|
| 45 |
+
for (let index = 0; index < length; index++) {
|
| 46 |
+
const char = input.charCodeAt(index);
|
| 47 |
+
|
| 48 |
+
// Check for ASCII chars that don't need escaping
|
| 49 |
+
if (
|
| 50 |
+
char < 0x80 &&
|
| 51 |
+
(((XML_BITSET_VALUE >>> char) & 1) === 0 || char >= 64 || char < 32)
|
| 52 |
+
) {
|
| 53 |
+
continue;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
if (out === undefined) out = input.substring(0, index);
|
| 57 |
+
else if (last !== index) out += input.substring(last, index);
|
| 58 |
+
|
| 59 |
+
if (char < 64) {
|
| 60 |
+
// Known replacement
|
| 61 |
+
out += xmlCodeMap.get(char)!;
|
| 62 |
+
last = index + 1;
|
| 63 |
+
continue;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
// Non-ASCII: encode as numeric entity (handle surrogate pair)
|
| 67 |
+
const cp = getCodePoint(input, index);
|
| 68 |
+
out += `&#x${cp.toString(16)};`;
|
| 69 |
+
if (cp !== char) index++; // Skip trailing surrogate
|
| 70 |
+
last = index + 1;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
if (out === undefined) return input;
|
| 74 |
+
if (last < length) out += input.substr(last);
|
| 75 |
+
return out;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
/**
|
| 79 |
+
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
| 80 |
+
* documents using numeric hexadecimal reference (eg. `ü`).
|
| 81 |
+
*
|
| 82 |
+
* Have a look at `escapeUTF8` if you want a more concise output at the expense
|
| 83 |
+
* of reduced transportability.
|
| 84 |
+
* @param data String to escape.
|
| 85 |
+
*/
|
| 86 |
+
export const escape: typeof encodeXML = encodeXML;
|
| 87 |
+
|
| 88 |
+
/**
|
| 89 |
+
* Creates a function that escapes all characters matched by the given regular
|
| 90 |
+
* expression using the given map of characters to escape to their entities.
|
| 91 |
+
* @param regex Regular expression to match characters to escape.
|
| 92 |
+
* @param map Map of characters to escape to their entities.
|
| 93 |
+
* @returns Function that escapes all characters matched by the given regular
|
| 94 |
+
* expression using the given map of characters to escape to their entities.
|
| 95 |
+
*/
|
| 96 |
+
function getEscaper(
|
| 97 |
+
regex: RegExp,
|
| 98 |
+
map: Map<number, string>,
|
| 99 |
+
): (data: string) => string {
|
| 100 |
+
return function escape(data: string): string {
|
| 101 |
+
let match: RegExpExecArray | null;
|
| 102 |
+
let lastIndex = 0;
|
| 103 |
+
let result = "";
|
| 104 |
+
|
| 105 |
+
while ((match = regex.exec(data))) {
|
| 106 |
+
if (lastIndex !== match.index) {
|
| 107 |
+
result += data.substring(lastIndex, match.index);
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
// We know that this character will be in the map.
|
| 111 |
+
result += map.get(match[0].charCodeAt(0))!;
|
| 112 |
+
|
| 113 |
+
// Every match will be of length 1
|
| 114 |
+
lastIndex = match.index + 1;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
return result + data.substring(lastIndex);
|
| 118 |
+
};
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/**
|
| 122 |
+
* Encodes all characters not valid in XML documents using XML entities.
|
| 123 |
+
*
|
| 124 |
+
* Note that the output will be character-set dependent.
|
| 125 |
+
* @param data String to escape.
|
| 126 |
+
*/
|
| 127 |
+
export const escapeUTF8: (data: string) => string = /* #__PURE__ */ getEscaper(
|
| 128 |
+
/["&'<>]/g,
|
| 129 |
+
xmlCodeMap,
|
| 130 |
+
);
|
| 131 |
+
|
| 132 |
+
/**
|
| 133 |
+
* Encodes all characters that have to be escaped in HTML attributes,
|
| 134 |
+
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
| 135 |
+
* @param data String to escape.
|
| 136 |
+
*/
|
| 137 |
+
export const escapeAttribute: (data: string) => string =
|
| 138 |
+
/* #__PURE__ */ getEscaper(
|
| 139 |
+
/["&\u00A0]/g,
|
| 140 |
+
new Map([
|
| 141 |
+
[34, """],
|
| 142 |
+
[38, "&"],
|
| 143 |
+
[160, " "],
|
| 144 |
+
]),
|
| 145 |
+
);
|
| 146 |
+
|
| 147 |
+
/**
|
| 148 |
+
* Encodes all characters that have to be escaped in HTML text,
|
| 149 |
+
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
| 150 |
+
* @param data String to escape.
|
| 151 |
+
*/
|
| 152 |
+
export const escapeText: (data: string) => string = /* #__PURE__ */ getEscaper(
|
| 153 |
+
/[&<>\u00A0]/g,
|
| 154 |
+
new Map([
|
| 155 |
+
[38, "&"],
|
| 156 |
+
[60, "<"],
|
| 157 |
+
[62, ">"],
|
| 158 |
+
[160, " "],
|
| 159 |
+
]),
|
| 160 |
+
);
|
node_modules/entities/src/generated/decode-data-html.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Generated using scripts/write-decode-map.ts
|
| 2 |
+
|
| 3 |
+
import { decodeBase64 } from "../internal/decode-shared.js";
|
| 4 |
+
/** Packed HTML decode trie data. */
|
| 5 |
+
export const htmlDecodeTree: Uint16Array = /* #__PURE__ */ decodeBase64(
|
| 6 |
+
"QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA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AOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg",
|
| 7 |
+
);
|
node_modules/entities/src/generated/decode-data-xml.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Generated using scripts/write-decode-map.ts
|
| 2 |
+
|
| 3 |
+
import { decodeBase64 } from "../internal/decode-shared.js";
|
| 4 |
+
/** Packed XML decode trie data. */
|
| 5 |
+
export const xmlDecodeTree: Uint16Array = /* #__PURE__ */ decodeBase64(
|
| 6 |
+
"AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg",
|
| 7 |
+
);
|
node_modules/entities/src/generated/encode-html.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Generated using scripts/write-encode-map.ts
|
| 2 |
+
// This file contains a compact, single-string serialization of the HTML encode trie.
|
| 3 |
+
// Format per entry (sequence in ascending code point order using diff encoding):
|
| 4 |
+
// <diffBase36>[&name;][{<children>}] -- diff omitted when 0.
|
| 5 |
+
// "&name;" gives the entity value for the node. A following { starts a nested sub-map.
|
| 6 |
+
// Diffs use the same scheme as before: diff = currentKey - previousKey - 1, first entry stores key.
|
| 7 |
+
|
| 8 |
+
import {
|
| 9 |
+
type EncodeTrieNode,
|
| 10 |
+
parseEncodeTrie,
|
| 11 |
+
} from "../internal/encode-shared.js";
|
| 12 |
+
|
| 13 |
+
/** Compact serialized HTML encode trie (intended to stay small & JS engine friendly) */
|
| 14 |
+
/** HTML entity encode trie. */
|
| 15 |
+
export const htmlTrie: Map<number, EncodeTrieNode> =
|
| 16 |
+
/* #__PURE__ */ parseEncodeTrie(
|
| 17 |
+
"9	
m!"#$%&'()*+,1./a:;<{6he<⃒}={6hx=⃥}>{6he>⃒}?@q[\]^_`5{2yfj}k{|}y ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒē2ĖėĘęĚěĜĝĞğĠġĢ1ĤĥĦħĨĩĪī2ĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌō2ŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžjƒyƵ1rǵ1tȷ3yˆˇg˘˙˚˛˜˝1f̑3jΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ1ΣΤΥΦΧΨΩ7αβγδεζηθικλμνξοπρςστυφχψω7ϑϒ2ϕϖ5Ϝϝiϰϱ3ϵ϶aЁЂЃЄЅІЇЈЉЊЋЌ1ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя1ёђѓєѕіїјљњћќ1ўџ5gi    1    ​‌‍‎‏‐2–—―‖1‘’‚1“”„1†‡•2‥…9‰‱′″‴‵3‹›3‾2⁁1⁃⁄a⁏7⁗7 {6bu  }⁠⁡⁢⁣20€1a⃛⃜11ℂ2℅4ℊℋℌℍℎℏℐℑℒℓ1ℕ№℗℘ℙℚℛℜℝ℞3™1ℤ2℧ℨ℩2ℬℭ1ℯℰℱ1ℳℴℵℶℷℸcⅅⅆⅇⅈa⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞1d←↑→↓↔↕↖↗↘↙↚↛1↝{mw↝̸}↞↟↠↡↢↣↤↥↦↧1↩↪↫↬↭↮1↰↱↲↳1↵↶↷2↺↻↼↽↾↿⇀⇁⇂⇃⇄⇅⇆⇇⇈⇉⇊⇋⇌⇍⇎⇏⇐⇑⇒⇓⇔⇕⇖⇗⇘⇙⇚⇛1⇝6⇤⇥f⇵7⇽⇾⇿∀∁∂{mw∂̸}∃∄∅1∇∈∉1∋∌2∏∐∑−∓∔1∖∗∘1√2∝∞∟∠{6he∠⃒}∡∢∣∤∥∦∧∨∩{1e68∩︀}∪{1e68∪︀}∫∬∭∮∯∰∱∲∳∴∵∶∷∸1∺∻∼{6he∼⃒}∽{mp∽̱}∾{mr∾̳}∿≀≁≂{mw≂̸}≃≄≅≆≇≈≉≊≋{mw≋̸}≌≍{6he≍⃒}≎{mw≎̸}≏{mw≏̸}≐{mw≐̸}≑≒≓≔≕≖≗1≙≚1≜2≟≠≡{6hx≡⃥}≢1≤{6he≤⃒}≥{6he≥⃒}≦{mw≦̸}≧{mw≧̸}≨{1e68≨︀}≩{1e68≩︀}≪{mw≪̸5uh≪⃒}≫{mw≫̸5uh≫⃒}≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿{mw≿̸}⊀⊁⊂{6he⊂⃒}⊃{6he⊃⃒}⊄⊅⊆⊇⊈⊉⊊{1e68⊊︀}⊋{1e68⊋︀}1⊍⊎⊏{mw⊏̸}⊐{mw⊐̸}⊑⊒⊓{1e68⊓︀}⊔{1e68⊔︀}⊕⊖⊗⊘⊙⊚⊛1⊝⊞⊟⊠⊡⊢⊣⊤⊥1⊧⊨⊩⊪⊫⊬⊭⊮⊯⊰1⊲⊳⊴{6he⊴⃒}⊵{6he⊵⃒}⊶⊷⊸⊹⊺⊻1⊽⊾⊿⋀⋁⋂⋃⋄⋅⋆⋇⋈⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋔⋕⋖⋗⋘{mw⋘̸}⋙{mw⋙̸}⋚{1e68⋚︀}⋛{1e68⋛︀}2⋞⋟⋠⋡⋢⋣2⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵{mw⋵̸}⋶⋷1⋹{mw⋹̸}⋺⋻⋼⋽⋾6⌅⌆1⌈⌉⌊⌋⌌⌍⌎⌏⌐1⌒⌓1⌕⌖5⌜⌝⌞⌟2⌢⌣9⌭⌮7⌶6⌽1⌿1o⍼1f⎰⎱2⎴⎵⎶11⏜⏝⏞⏟2⏢4⏧1n␣4kⓈ1j─1│9┌3┐3└3┘3├7┤7┬7┴7┼j═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬j▀3▄3█8░▒▓d□8▪▫1▭▮2▱1△▴▵2▸▹3▽▾▿2◂◃6◊○w◬2◯8◸◹◺◻◼8★☆7☎1d♀1♂t♠2♣1♥♦3♪2♭♮♯4j✓3✗8✠l✶x❘p❲❳2c⟈⟉s⟦⟧⟨⟩⟪⟫⟬⟭7⟵⟶⟷⟸⟹⟺1⟼2⟿76⤂⤃⤄⤅6⤌⤍⤎⤏⤐⤑⤒⤓2⤖2⤙⤚⤛⤜⤝⤞⤟⤠2⤣⤤⤥⤦⤧⤨⤩⤪8⤳{mw⤳̸}1⤵⤶⤷⤸⤹2⤼⤽7⥅2⥈⥉⥊⥋2⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩⥪⥫⥬⥭⥮⥯⥰⥱⥲⥳⥴⥵⥶1⥸⥹1⥻⥼⥽⥾⥿5⦅⦆4⦋⦌⦍⦎⦏⦐⦑⦒⦓⦔⦕⦖3⦚1⦜⦝6⦤⦥⦦⦧⦨⦩⦪⦫⦬⦭⦮⦯⦰⦱⦲⦳⦴⦵⦶⦷1⦹1⦻⦼1⦾⦿⧀⧁⧂⧃⧄⧅3⧉3⧍⧎⧏{mw⧏̸}⧐{mw⧐̸}b⧜⧝⧞4⧣⧤⧥5⧫8⧴1⧶9⨀⨁⨂1⨄1⨆5⨌⨍2⨐⨑⨒⨓⨔⨕⨖⨗a⨢⨣⨤⨥⨦⨧1⨩⨪2⨭⨮⨯⨰⨱1⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼2⨿⩀1⩂⩃⩄⩅⩆⩇⩈⩉⩊⩋⩌⩍2⩐2⩓⩔⩕⩖⩗⩘1⩚⩛⩜⩝1⩟6⩦3⩪2⩭{mw⩭̸}⩮⩯⩰{mw⩰̸}⩱⩲⩳⩴⩵1⩷⩸⩹⩺⩻⩼⩽{mw⩽̸}⩾{mw⩾̸}⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚2⪝⪞⪟⪠⪡{mw⪡̸}⪢{mw⪢̸}1⪤⪥⪦⪧⪨⪩⪪⪫⪬{1e68⪬︀}⪭{1e68⪭︀}⪮⪯{mw⪯̸}⪰{mw⪰̸}2⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅{mw⫅̸}⫆{mw⫆̸}⫇⫈2⫋{1e68⫋︀}⫌{1e68⫌︀}2⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫚⫛8⫤1⫦⫧⫨⫩1⫫⫬⫭⫮⫯⫰⫱⫲⫳9⫽{6hx⫽⃥}y7r{17ks𝒜1𝒞𝒟2𝒢2𝒥𝒦2𝒩𝒪𝒫𝒬1𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵𝒶𝒷𝒸𝒹1𝒻1𝒽𝒾𝒿𝓀𝓁𝓂𝓃1𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏1g𝔄𝔅1𝔇𝔈𝔉𝔊2𝔍𝔎𝔏𝔐𝔑𝔒𝔓𝔔1𝔖𝔗𝔘𝔙𝔚𝔛𝔜1𝔞𝔟𝔠𝔡𝔢𝔣𝔤𝔥𝔦𝔧𝔨𝔩𝔪𝔫𝔬𝔭𝔮𝔯𝔰𝔱𝔲𝔳𝔴𝔵𝔶𝔷𝔸𝔹1𝔻𝔼𝔽𝔾1𝕀𝕁𝕂𝕃𝕄1𝕆3𝕊𝕋𝕌𝕍𝕎𝕏𝕐1𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫}6vefffiflffiffl",
|
| 18 |
+
);
|
node_modules/entities/src/index.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { type DecodingMode, decodeHTML, decodeXML } from "./decode.js";
|
| 2 |
+
import { encodeHTML, encodeNonAsciiHTML } from "./encode.js";
|
| 3 |
+
import {
|
| 4 |
+
encodeXML,
|
| 5 |
+
escapeAttribute,
|
| 6 |
+
escapeText,
|
| 7 |
+
escapeUTF8,
|
| 8 |
+
} from "./escape.js";
|
| 9 |
+
|
| 10 |
+
/** The level of entities to support. */
|
| 11 |
+
export enum EntityLevel {
|
| 12 |
+
/** Support only XML entities. */
|
| 13 |
+
XML = 0,
|
| 14 |
+
/** Support HTML entities, which are a superset of XML entities. */
|
| 15 |
+
HTML = 1,
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
/**
|
| 19 |
+
* Encoding strategy used by `encode`.
|
| 20 |
+
*/
|
| 21 |
+
export enum EncodingMode {
|
| 22 |
+
/**
|
| 23 |
+
* The output is UTF-8 encoded. Only characters that need escaping within
|
| 24 |
+
* XML will be escaped.
|
| 25 |
+
*/
|
| 26 |
+
UTF8,
|
| 27 |
+
/**
|
| 28 |
+
* The output consists only of ASCII characters. Characters that need
|
| 29 |
+
* escaping within HTML, and characters that aren't ASCII characters will
|
| 30 |
+
* be escaped.
|
| 31 |
+
*/
|
| 32 |
+
ASCII,
|
| 33 |
+
/**
|
| 34 |
+
* Encode all characters that have an equivalent entity, as well as all
|
| 35 |
+
* characters that are not ASCII characters.
|
| 36 |
+
*/
|
| 37 |
+
Extensive,
|
| 38 |
+
/**
|
| 39 |
+
* Encode all characters that have to be escaped in HTML attributes,
|
| 40 |
+
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
| 41 |
+
*/
|
| 42 |
+
Attribute,
|
| 43 |
+
/**
|
| 44 |
+
* Encode all characters that have to be escaped in HTML text,
|
| 45 |
+
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
| 46 |
+
*/
|
| 47 |
+
Text,
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/**
|
| 51 |
+
* Options for `decode`.
|
| 52 |
+
*/
|
| 53 |
+
export interface DecodingOptions {
|
| 54 |
+
/**
|
| 55 |
+
* The level of entities to support.
|
| 56 |
+
* @default {@link EntityLevel.XML}
|
| 57 |
+
*/
|
| 58 |
+
level?: EntityLevel;
|
| 59 |
+
/**
|
| 60 |
+
* Decoding mode. If `Legacy`, will support legacy entities not terminated
|
| 61 |
+
* with a semicolon (`;`).
|
| 62 |
+
*
|
| 63 |
+
* Always `Strict` for XML. For HTML, set this to `true` if you are parsing
|
| 64 |
+
* an attribute value.
|
| 65 |
+
* @default {@link DecodingMode.Legacy}
|
| 66 |
+
*/
|
| 67 |
+
mode?: DecodingMode | undefined;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* Decodes a string with entities.
|
| 72 |
+
* @param input String to decode.
|
| 73 |
+
* @param options Decoding options.
|
| 74 |
+
*/
|
| 75 |
+
export function decode(
|
| 76 |
+
input: string,
|
| 77 |
+
options: DecodingOptions | EntityLevel = EntityLevel.XML,
|
| 78 |
+
): string {
|
| 79 |
+
const level = typeof options === "number" ? options : options.level;
|
| 80 |
+
|
| 81 |
+
if (level === EntityLevel.HTML) {
|
| 82 |
+
const mode = typeof options === "object" ? options.mode : undefined;
|
| 83 |
+
return decodeHTML(input, mode);
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
return decodeXML(input);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
/**
|
| 90 |
+
* Options for `encode`.
|
| 91 |
+
*/
|
| 92 |
+
export interface EncodingOptions {
|
| 93 |
+
/**
|
| 94 |
+
* The level of entities to support.
|
| 95 |
+
* @default {@link EntityLevel.XML}
|
| 96 |
+
*/
|
| 97 |
+
level?: EntityLevel;
|
| 98 |
+
/**
|
| 99 |
+
* Output format.
|
| 100 |
+
* @default {@link EncodingMode.Extensive}
|
| 101 |
+
*/
|
| 102 |
+
mode?: EncodingMode;
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
/**
|
| 106 |
+
* Encodes a string with entities.
|
| 107 |
+
* @param input String to encode.
|
| 108 |
+
* @param options Encoding options.
|
| 109 |
+
*/
|
| 110 |
+
export function encode(
|
| 111 |
+
input: string,
|
| 112 |
+
options: EncodingOptions | EntityLevel = EntityLevel.XML,
|
| 113 |
+
): string {
|
| 114 |
+
const { mode = EncodingMode.Extensive, level = EntityLevel.XML } =
|
| 115 |
+
typeof options === "number" ? { level: options } : options;
|
| 116 |
+
|
| 117 |
+
switch (mode) {
|
| 118 |
+
case EncodingMode.UTF8: {
|
| 119 |
+
return escapeUTF8(input);
|
| 120 |
+
}
|
| 121 |
+
case EncodingMode.Attribute: {
|
| 122 |
+
return escapeAttribute(input);
|
| 123 |
+
}
|
| 124 |
+
case EncodingMode.Text: {
|
| 125 |
+
return escapeText(input);
|
| 126 |
+
}
|
| 127 |
+
case EncodingMode.ASCII: {
|
| 128 |
+
return level === EntityLevel.HTML
|
| 129 |
+
? encodeNonAsciiHTML(input)
|
| 130 |
+
: encodeXML(input);
|
| 131 |
+
}
|
| 132 |
+
// biome-ignore lint/complexity/noUselessSwitchCase: we get an error for the switch not being exhaustive
|
| 133 |
+
case EncodingMode.Extensive:
|
| 134 |
+
default: {
|
| 135 |
+
return level === EntityLevel.HTML
|
| 136 |
+
? encodeHTML(input)
|
| 137 |
+
: encodeXML(input);
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
export {
|
| 143 |
+
DecodingMode,
|
| 144 |
+
decodeHTML,
|
| 145 |
+
decodeHTMLAttribute,
|
| 146 |
+
decodeHTMLStrict,
|
| 147 |
+
decodeXML,
|
| 148 |
+
decodeXML as decodeXMLStrict,
|
| 149 |
+
EntityDecoder,
|
| 150 |
+
} from "./decode.js";
|
| 151 |
+
|
| 152 |
+
export {
|
| 153 |
+
encodeHTML,
|
| 154 |
+
encodeNonAsciiHTML,
|
| 155 |
+
} from "./encode.js";
|
| 156 |
+
export {
|
| 157 |
+
encodeXML,
|
| 158 |
+
escape,
|
| 159 |
+
escapeAttribute,
|
| 160 |
+
escapeText,
|
| 161 |
+
escapeUTF8,
|
| 162 |
+
} from "./escape.js";
|
node_modules/entities/src/internal/bin-trie-flags.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Bit flags & masks for the binary trie encoding used for entity decoding.
|
| 3 |
+
*
|
| 4 |
+
* Bit layout (16 bits total):
|
| 5 |
+
* 15..14 VALUE_LENGTH (+1 encoding; 0 => no value)
|
| 6 |
+
* 13 FLAG13. If valueLength>0: semicolon required flag (implicit ';').
|
| 7 |
+
* If valueLength==0: compact run flag.
|
| 8 |
+
* 12..7 BRANCH_LENGTH Branch length (0 => single branch in 6..0 if jumpOffset==char) OR run length (when compact run)
|
| 9 |
+
* 6..0 JUMP_TABLE Jump offset (jump table) OR single-branch char code OR first run char
|
| 10 |
+
*/
|
| 11 |
+
export enum BinTrieFlags {
|
| 12 |
+
VALUE_LENGTH = 0b1100_0000_0000_0000,
|
| 13 |
+
FLAG13 = 0b0010_0000_0000_0000,
|
| 14 |
+
BRANCH_LENGTH = 0b0001_1111_1000_0000,
|
| 15 |
+
JUMP_TABLE = 0b0000_0000_0111_1111,
|
| 16 |
+
}
|
node_modules/entities/src/internal/decode-shared.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Shared base64 decode helper for generated decode data.
|
| 3 |
+
* Assumes global atob is available.
|
| 4 |
+
* @param input Input string to encode or decode.
|
| 5 |
+
*/
|
| 6 |
+
export function decodeBase64(input: string): Uint16Array {
|
| 7 |
+
const binary: string = atob(input);
|
| 8 |
+
const evenLength = binary.length & ~1; // Round down to even length
|
| 9 |
+
const out = new Uint16Array(evenLength / 2);
|
| 10 |
+
|
| 11 |
+
for (let index = 0, outIndex = 0; index < evenLength; index += 2) {
|
| 12 |
+
const lo = binary.charCodeAt(index);
|
| 13 |
+
const hi = binary.charCodeAt(index + 1);
|
| 14 |
+
out[outIndex++] = lo | (hi << 8);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
return out;
|
| 18 |
+
}
|
node_modules/entities/src/internal/encode-shared.ts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* A node inside the encoding trie used by `encode.ts`.
|
| 3 |
+
*
|
| 4 |
+
* There are two physical shapes to minimize allocations and lookup cost:
|
| 5 |
+
*
|
| 6 |
+
* 1. Leaf node (string)
|
| 7 |
+
* - A plain string (already in the form `"&name;"`).
|
| 8 |
+
* - Represents a terminal match with no children.
|
| 9 |
+
*
|
| 10 |
+
* 2. Branch / value node (object)
|
| 11 |
+
*/
|
| 12 |
+
export type EncodeTrieNode =
|
| 13 |
+
| string
|
| 14 |
+
| {
|
| 15 |
+
/**
|
| 16 |
+
* Entity value for the current code point sequence (wrapped: `&...;`).
|
| 17 |
+
* Present when the path to this node itself is a valid named entity.
|
| 18 |
+
*/
|
| 19 |
+
value: string | undefined;
|
| 20 |
+
/** If a number, the next code unit of the only next character. */
|
| 21 |
+
next: number | Map<number, EncodeTrieNode>;
|
| 22 |
+
/** If next is a number, `nextValue` contains the entity value. */
|
| 23 |
+
nextValue?: string;
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* Parse a compact encode trie string into a Map structure used for encoding.
|
| 28 |
+
*
|
| 29 |
+
* Format per entry (ascending code points using delta encoding):
|
| 30 |
+
* <diffBase36>[&name;][{<children>}] -- diff omitted when 0
|
| 31 |
+
* Where diff = currentKey - previousKey - 1 (first entry stores absolute key).
|
| 32 |
+
* `&name;` is the entity value (already wrapped); a following `{` denotes children.
|
| 33 |
+
* @param serialized Serialized text fragment to encode.
|
| 34 |
+
*/
|
| 35 |
+
export function parseEncodeTrie(
|
| 36 |
+
serialized: string,
|
| 37 |
+
): Map<number, EncodeTrieNode> {
|
| 38 |
+
const top = new Map<number, EncodeTrieNode>();
|
| 39 |
+
const totalLength = serialized.length;
|
| 40 |
+
let cursor = 0;
|
| 41 |
+
let lastTopKey = -1;
|
| 42 |
+
|
| 43 |
+
function readDiff(): number {
|
| 44 |
+
const start = cursor;
|
| 45 |
+
while (cursor < totalLength) {
|
| 46 |
+
const char = serialized.charAt(cursor);
|
| 47 |
+
|
| 48 |
+
if ((char < "0" || char > "9") && (char < "a" || char > "z")) {
|
| 49 |
+
break;
|
| 50 |
+
}
|
| 51 |
+
cursor++;
|
| 52 |
+
}
|
| 53 |
+
if (cursor === start) return 0;
|
| 54 |
+
return Number.parseInt(serialized.slice(start, cursor), 36);
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
function readEntity(): string {
|
| 58 |
+
if (serialized[cursor] !== "&") {
|
| 59 |
+
throw new Error(`Child entry missing value near index ${cursor}`);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
// Cursor currently points at '&'
|
| 63 |
+
const start = cursor;
|
| 64 |
+
const end = serialized.indexOf(";", cursor + 1);
|
| 65 |
+
if (end === -1) {
|
| 66 |
+
throw new Error(`Unterminated entity starting at index ${start}`);
|
| 67 |
+
}
|
| 68 |
+
cursor = end + 1; // Move past ';'
|
| 69 |
+
return serialized.slice(start, cursor); // Includes & ... ;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
while (cursor < totalLength) {
|
| 73 |
+
const keyDiff = readDiff();
|
| 74 |
+
const key = lastTopKey === -1 ? keyDiff : lastTopKey + keyDiff + 1;
|
| 75 |
+
|
| 76 |
+
let value: string | undefined;
|
| 77 |
+
if (serialized[cursor] === "&") value = readEntity();
|
| 78 |
+
|
| 79 |
+
if (serialized[cursor] === "{") {
|
| 80 |
+
cursor++; // Skip '{'
|
| 81 |
+
// Parse first child
|
| 82 |
+
let diff = readDiff();
|
| 83 |
+
let childKey = diff; // First key (lastChildKey = -1)
|
| 84 |
+
const firstValue = readEntity();
|
| 85 |
+
if (serialized[cursor] === "{") {
|
| 86 |
+
throw new Error("Unexpected nested '{' beyond depth 2");
|
| 87 |
+
}
|
| 88 |
+
// If end of block -> single child optimization
|
| 89 |
+
if (serialized[cursor] === "}") {
|
| 90 |
+
top.set(key, { value, next: childKey, nextValue: firstValue });
|
| 91 |
+
cursor++; // Skip '}'
|
| 92 |
+
} else {
|
| 93 |
+
const childMap = new Map<number, EncodeTrieNode>([
|
| 94 |
+
[childKey, firstValue],
|
| 95 |
+
]);
|
| 96 |
+
let lastChildKey = childKey;
|
| 97 |
+
while (cursor < totalLength && serialized[cursor] !== "}") {
|
| 98 |
+
diff = readDiff();
|
| 99 |
+
childKey = lastChildKey + diff + 1;
|
| 100 |
+
const childValue = readEntity();
|
| 101 |
+
if (serialized[cursor] === "{") {
|
| 102 |
+
throw new Error("Unexpected nested '{' beyond depth 2");
|
| 103 |
+
}
|
| 104 |
+
childMap.set(childKey, childValue);
|
| 105 |
+
lastChildKey = childKey;
|
| 106 |
+
}
|
| 107 |
+
if (serialized[cursor] !== "}") {
|
| 108 |
+
throw new Error("Unterminated child block");
|
| 109 |
+
}
|
| 110 |
+
cursor++; // Skip '}'
|
| 111 |
+
top.set(key, { value, next: childMap });
|
| 112 |
+
}
|
| 113 |
+
} else if (value === undefined) {
|
| 114 |
+
throw new Error(
|
| 115 |
+
`Malformed encode trie: missing value at index ${cursor}`,
|
| 116 |
+
);
|
| 117 |
+
} else {
|
| 118 |
+
top.set(key, value);
|
| 119 |
+
}
|
| 120 |
+
lastTopKey = key;
|
| 121 |
+
}
|
| 122 |
+
return top;
|
| 123 |
+
}
|
node_modules/es-define-property/.eslintrc
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"root": true,
|
| 3 |
+
|
| 4 |
+
"extends": "@ljharb",
|
| 5 |
+
|
| 6 |
+
"rules": {
|
| 7 |
+
"new-cap": ["error", {
|
| 8 |
+
"capIsNewExceptions": [
|
| 9 |
+
"GetIntrinsic",
|
| 10 |
+
],
|
| 11 |
+
}],
|
| 12 |
+
},
|
| 13 |
+
}
|
node_modules/es-define-property/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# These are supported funding model platforms
|
| 2 |
+
|
| 3 |
+
github: [ljharb]
|
| 4 |
+
patreon: # Replace with a single Patreon username
|
| 5 |
+
open_collective: # Replace with a single Open Collective username
|
| 6 |
+
ko_fi: # Replace with a single Ko-fi username
|
| 7 |
+
tidelift: npm/es-define-property
|
| 8 |
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
| 9 |
+
liberapay: # Replace with a single Liberapay username
|
| 10 |
+
issuehunt: # Replace with a single IssueHunt username
|
| 11 |
+
otechie: # Replace with a single Otechie username
|
| 12 |
+
custom: # Replace with a single custom sponsorship URL
|
node_modules/es-define-property/.nycrc
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"all": true,
|
| 3 |
+
"check-coverage": false,
|
| 4 |
+
"reporter": ["text-summary", "text", "html", "json"],
|
| 5 |
+
"exclude": [
|
| 6 |
+
"coverage",
|
| 7 |
+
"test"
|
| 8 |
+
]
|
| 9 |
+
}
|
node_modules/es-define-property/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelog
|
| 2 |
+
|
| 3 |
+
All notable changes to this project will be documented in this file.
|
| 4 |
+
|
| 5 |
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
| 6 |
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
| 7 |
+
|
| 8 |
+
## [v1.0.1](https://github.com/ljharb/es-define-property/compare/v1.0.0...v1.0.1) - 2024-12-06
|
| 9 |
+
|
| 10 |
+
### Commits
|
| 11 |
+
|
| 12 |
+
- [types] use shared tsconfig [`954a663`](https://github.com/ljharb/es-define-property/commit/954a66360326e508a0e5daa4b07493d58f5e110e)
|
| 13 |
+
- [actions] split out node 10-20, and 20+ [`3a8e84b`](https://github.com/ljharb/es-define-property/commit/3a8e84b23883f26ff37b3e82ff283834228e18c6)
|
| 14 |
+
- [Dev Deps] update `@ljharb/eslint-config`, `@ljharb/tsconfig`, `@types/get-intrinsic`, `@types/tape`, `auto-changelog`, `gopd`, `tape` [`86ae27b`](https://github.com/ljharb/es-define-property/commit/86ae27bb8cc857b23885136fad9cbe965ae36612)
|
| 15 |
+
- [Refactor] avoid using `get-intrinsic` [`02480c0`](https://github.com/ljharb/es-define-property/commit/02480c0353ef6118965282977c3864aff53d98b1)
|
| 16 |
+
- [Tests] replace `aud` with `npm audit` [`f6093ff`](https://github.com/ljharb/es-define-property/commit/f6093ff74ab51c98015c2592cd393bd42478e773)
|
| 17 |
+
- [Tests] configure testling [`7139e66`](https://github.com/ljharb/es-define-property/commit/7139e66959247a56086d9977359caef27c6849e7)
|
| 18 |
+
- [Dev Deps] update `tape` [`b901b51`](https://github.com/ljharb/es-define-property/commit/b901b511a75e001a40ce1a59fef7d9ffcfc87482)
|
| 19 |
+
- [Tests] fix types in tests [`469d269`](https://github.com/ljharb/es-define-property/commit/469d269fd141b1e773ec053a9fa35843493583e0)
|
| 20 |
+
- [Dev Deps] add missing peer dep [`733acfb`](https://github.com/ljharb/es-define-property/commit/733acfb0c4c96edf337e470b89a25a5b3724c352)
|
| 21 |
+
|
| 22 |
+
## v1.0.0 - 2024-02-12
|
| 23 |
+
|
| 24 |
+
### Commits
|
| 25 |
+
|
| 26 |
+
- Initial implementation, tests, readme, types [`3e154e1`](https://github.com/ljharb/es-define-property/commit/3e154e11a2fee09127220f5e503bf2c0a31dd480)
|
| 27 |
+
- Initial commit [`07d98de`](https://github.com/ljharb/es-define-property/commit/07d98de34a4dc31ff5e83a37c0c3f49e0d85cd50)
|
| 28 |
+
- npm init [`c4eb634`](https://github.com/ljharb/es-define-property/commit/c4eb6348b0d3886aac36cef34ad2ee0665ea6f3e)
|
| 29 |
+
- Only apps should have lockfiles [`7af86ec`](https://github.com/ljharb/es-define-property/commit/7af86ec1d311ec0b17fdfe616a25f64276903856)
|
node_modules/es-define-property/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2024 Jordan Harband
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
node_modules/es-define-property/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# es-define-property <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
| 2 |
+
|
| 3 |
+
[![github actions][actions-image]][actions-url]
|
| 4 |
+
[![coverage][codecov-image]][codecov-url]
|
| 5 |
+
[![License][license-image]][license-url]
|
| 6 |
+
[![Downloads][downloads-image]][downloads-url]
|
| 7 |
+
|
| 8 |
+
[![npm badge][npm-badge-png]][package-url]
|
| 9 |
+
|
| 10 |
+
`Object.defineProperty`, but not IE 8's broken one.
|
| 11 |
+
|
| 12 |
+
## Example
|
| 13 |
+
|
| 14 |
+
```js
|
| 15 |
+
const assert = require('assert');
|
| 16 |
+
|
| 17 |
+
const $defineProperty = require('es-define-property');
|
| 18 |
+
|
| 19 |
+
if ($defineProperty) {
|
| 20 |
+
assert.equal($defineProperty, Object.defineProperty);
|
| 21 |
+
} else if (Object.defineProperty) {
|
| 22 |
+
assert.equal($defineProperty, false, 'this is IE 8');
|
| 23 |
+
} else {
|
| 24 |
+
assert.equal($defineProperty, false, 'this is an ES3 engine');
|
| 25 |
+
}
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
## Tests
|
| 29 |
+
Simply clone the repo, `npm install`, and run `npm test`
|
| 30 |
+
|
| 31 |
+
## Security
|
| 32 |
+
|
| 33 |
+
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
|
| 34 |
+
|
| 35 |
+
[package-url]: https://npmjs.org/package/es-define-property
|
| 36 |
+
[npm-version-svg]: https://versionbadg.es/ljharb/es-define-property.svg
|
| 37 |
+
[deps-svg]: https://david-dm.org/ljharb/es-define-property.svg
|
| 38 |
+
[deps-url]: https://david-dm.org/ljharb/es-define-property
|
| 39 |
+
[dev-deps-svg]: https://david-dm.org/ljharb/es-define-property/dev-status.svg
|
| 40 |
+
[dev-deps-url]: https://david-dm.org/ljharb/es-define-property#info=devDependencies
|
| 41 |
+
[npm-badge-png]: https://nodei.co/npm/es-define-property.png?downloads=true&stars=true
|
| 42 |
+
[license-image]: https://img.shields.io/npm/l/es-define-property.svg
|
| 43 |
+
[license-url]: LICENSE
|
| 44 |
+
[downloads-image]: https://img.shields.io/npm/dm/es-define-property.svg
|
| 45 |
+
[downloads-url]: https://npm-stat.com/charts.html?package=es-define-property
|
| 46 |
+
[codecov-image]: https://codecov.io/gh/ljharb/es-define-property/branch/main/graphs/badge.svg
|
| 47 |
+
[codecov-url]: https://app.codecov.io/gh/ljharb/es-define-property/
|
| 48 |
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-define-property
|
| 49 |
+
[actions-url]: https://github.com/ljharb/es-define-property/actions
|
node_modules/es-define-property/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const defineProperty: false | typeof Object.defineProperty;
|
| 2 |
+
|
| 3 |
+
export = defineProperty;
|
node_modules/es-define-property/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('.')} */
|
| 4 |
+
var $defineProperty = Object.defineProperty || false;
|
| 5 |
+
if ($defineProperty) {
|
| 6 |
+
try {
|
| 7 |
+
$defineProperty({}, 'a', { value: 1 });
|
| 8 |
+
} catch (e) {
|
| 9 |
+
// IE 8 has a broken defineProperty
|
| 10 |
+
$defineProperty = false;
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
module.exports = $defineProperty;
|
node_modules/es-define-property/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "es-define-property",
|
| 3 |
+
"version": "1.0.1",
|
| 4 |
+
"description": "`Object.defineProperty`, but not IE 8's broken one.",
|
| 5 |
+
"main": "index.js",
|
| 6 |
+
"types": "./index.d.ts",
|
| 7 |
+
"exports": {
|
| 8 |
+
".": "./index.js",
|
| 9 |
+
"./package.json": "./package.json"
|
| 10 |
+
},
|
| 11 |
+
"sideEffects": false,
|
| 12 |
+
"scripts": {
|
| 13 |
+
"prepack": "npmignore --auto --commentLines=autogenerated",
|
| 14 |
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
| 15 |
+
"prepublishOnly": "safe-publish-latest",
|
| 16 |
+
"prelint": "evalmd README.md",
|
| 17 |
+
"lint": "eslint --ext=js,mjs .",
|
| 18 |
+
"postlint": "tsc -p .",
|
| 19 |
+
"pretest": "npm run lint",
|
| 20 |
+
"tests-only": "nyc tape 'test/**/*.js'",
|
| 21 |
+
"test": "npm run tests-only",
|
| 22 |
+
"posttest": "npx npm@'>= 10.2' audit --production",
|
| 23 |
+
"version": "auto-changelog && git add CHANGELOG.md",
|
| 24 |
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
| 25 |
+
},
|
| 26 |
+
"repository": {
|
| 27 |
+
"type": "git",
|
| 28 |
+
"url": "git+https://github.com/ljharb/es-define-property.git"
|
| 29 |
+
},
|
| 30 |
+
"keywords": [
|
| 31 |
+
"javascript",
|
| 32 |
+
"ecmascript",
|
| 33 |
+
"object",
|
| 34 |
+
"define",
|
| 35 |
+
"property",
|
| 36 |
+
"defineProperty",
|
| 37 |
+
"Object.defineProperty"
|
| 38 |
+
],
|
| 39 |
+
"author": "Jordan Harband <ljharb@gmail.com>",
|
| 40 |
+
"license": "MIT",
|
| 41 |
+
"bugs": {
|
| 42 |
+
"url": "https://github.com/ljharb/es-define-property/issues"
|
| 43 |
+
},
|
| 44 |
+
"homepage": "https://github.com/ljharb/es-define-property#readme",
|
| 45 |
+
"devDependencies": {
|
| 46 |
+
"@ljharb/eslint-config": "^21.1.1",
|
| 47 |
+
"@ljharb/tsconfig": "^0.2.2",
|
| 48 |
+
"@types/gopd": "^1.0.3",
|
| 49 |
+
"@types/tape": "^5.6.5",
|
| 50 |
+
"auto-changelog": "^2.5.0",
|
| 51 |
+
"encoding": "^0.1.13",
|
| 52 |
+
"eslint": "^8.8.0",
|
| 53 |
+
"evalmd": "^0.0.19",
|
| 54 |
+
"gopd": "^1.2.0",
|
| 55 |
+
"in-publish": "^2.0.1",
|
| 56 |
+
"npmignore": "^0.3.1",
|
| 57 |
+
"nyc": "^10.3.2",
|
| 58 |
+
"safe-publish-latest": "^2.0.0",
|
| 59 |
+
"tape": "^5.9.0",
|
| 60 |
+
"typescript": "next"
|
| 61 |
+
},
|
| 62 |
+
"engines": {
|
| 63 |
+
"node": ">= 0.4"
|
| 64 |
+
},
|
| 65 |
+
"testling": {
|
| 66 |
+
"files": "test/index.js"
|
| 67 |
+
},
|
| 68 |
+
"auto-changelog": {
|
| 69 |
+
"output": "CHANGELOG.md",
|
| 70 |
+
"template": "keepachangelog",
|
| 71 |
+
"unreleased": false,
|
| 72 |
+
"commitLimit": false,
|
| 73 |
+
"backfillLimit": false,
|
| 74 |
+
"hideCredit": true
|
| 75 |
+
},
|
| 76 |
+
"publishConfig": {
|
| 77 |
+
"ignore": [
|
| 78 |
+
".github/workflows"
|
| 79 |
+
]
|
| 80 |
+
}
|
| 81 |
+
}
|
node_modules/es-define-property/test/index.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var $defineProperty = require('../');
|
| 4 |
+
|
| 5 |
+
var test = require('tape');
|
| 6 |
+
var gOPD = require('gopd');
|
| 7 |
+
|
| 8 |
+
test('defineProperty: supported', { skip: !$defineProperty }, function (t) {
|
| 9 |
+
t.plan(4);
|
| 10 |
+
|
| 11 |
+
t.equal(typeof $defineProperty, 'function', 'defineProperty is supported');
|
| 12 |
+
if ($defineProperty && gOPD) { // this `if` check is just to shut TS up
|
| 13 |
+
/** @type {{ a: number, b?: number, c?: number }} */
|
| 14 |
+
var o = { a: 1 };
|
| 15 |
+
|
| 16 |
+
$defineProperty(o, 'b', { enumerable: true, value: 2 });
|
| 17 |
+
t.deepEqual(
|
| 18 |
+
gOPD(o, 'b'),
|
| 19 |
+
{
|
| 20 |
+
configurable: false,
|
| 21 |
+
enumerable: true,
|
| 22 |
+
value: 2,
|
| 23 |
+
writable: false
|
| 24 |
+
},
|
| 25 |
+
'property descriptor is as expected'
|
| 26 |
+
);
|
| 27 |
+
|
| 28 |
+
$defineProperty(o, 'c', { enumerable: false, value: 3, writable: true });
|
| 29 |
+
t.deepEqual(
|
| 30 |
+
gOPD(o, 'c'),
|
| 31 |
+
{
|
| 32 |
+
configurable: false,
|
| 33 |
+
enumerable: false,
|
| 34 |
+
value: 3,
|
| 35 |
+
writable: true
|
| 36 |
+
},
|
| 37 |
+
'property descriptor is as expected'
|
| 38 |
+
);
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
t.equal($defineProperty, Object.defineProperty, 'defineProperty is Object.defineProperty');
|
| 42 |
+
|
| 43 |
+
t.end();
|
| 44 |
+
});
|
| 45 |
+
|
| 46 |
+
test('defineProperty: not supported', { skip: !!$defineProperty }, function (t) {
|
| 47 |
+
t.notOk($defineProperty, 'defineProperty is not supported');
|
| 48 |
+
|
| 49 |
+
t.match(
|
| 50 |
+
typeof $defineProperty,
|
| 51 |
+
/^(?:undefined|boolean)$/,
|
| 52 |
+
'`typeof defineProperty` is `undefined` or `boolean`'
|
| 53 |
+
);
|
| 54 |
+
|
| 55 |
+
t.end();
|
| 56 |
+
});
|
node_modules/es-define-property/tsconfig.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"extends": "@ljharb/tsconfig",
|
| 3 |
+
"compilerOptions": {
|
| 4 |
+
"target": "es2022",
|
| 5 |
+
},
|
| 6 |
+
"exclude": [
|
| 7 |
+
"coverage",
|
| 8 |
+
"test/list-exports"
|
| 9 |
+
],
|
| 10 |
+
}
|
node_modules/es-errors/.eslintrc
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"root": true,
|
| 3 |
+
|
| 4 |
+
"extends": "@ljharb",
|
| 5 |
+
}
|
node_modules/es-errors/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# These are supported funding model platforms
|
| 2 |
+
|
| 3 |
+
github: [ljharb]
|
| 4 |
+
patreon: # Replace with a single Patreon username
|
| 5 |
+
open_collective: # Replace with a single Open Collective username
|
| 6 |
+
ko_fi: # Replace with a single Ko-fi username
|
| 7 |
+
tidelift: npm/es-errors
|
| 8 |
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
| 9 |
+
liberapay: # Replace with a single Liberapay username
|
| 10 |
+
issuehunt: # Replace with a single IssueHunt username
|
| 11 |
+
otechie: # Replace with a single Otechie username
|
| 12 |
+
custom: # Replace with a single custom sponsorship URL
|
node_modules/es-errors/CHANGELOG.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Changelog
|
| 2 |
+
|
| 3 |
+
All notable changes to this project will be documented in this file.
|
| 4 |
+
|
| 5 |
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
| 6 |
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
| 7 |
+
|
| 8 |
+
## [v1.3.0](https://github.com/ljharb/es-errors/compare/v1.2.1...v1.3.0) - 2024-02-05
|
| 9 |
+
|
| 10 |
+
### Commits
|
| 11 |
+
|
| 12 |
+
- [New] add `EvalError` and `URIError` [`1927627`](https://github.com/ljharb/es-errors/commit/1927627ba68cb6c829d307231376c967db53acdf)
|
| 13 |
+
|
| 14 |
+
## [v1.2.1](https://github.com/ljharb/es-errors/compare/v1.2.0...v1.2.1) - 2024-02-04
|
| 15 |
+
|
| 16 |
+
### Commits
|
| 17 |
+
|
| 18 |
+
- [Fix] add missing `exports` entry [`5bb5f28`](https://github.com/ljharb/es-errors/commit/5bb5f280f98922701109d6ebb82eea2257cecc7e)
|
| 19 |
+
|
| 20 |
+
## [v1.2.0](https://github.com/ljharb/es-errors/compare/v1.1.0...v1.2.0) - 2024-02-04
|
| 21 |
+
|
| 22 |
+
### Commits
|
| 23 |
+
|
| 24 |
+
- [New] add `ReferenceError` [`6d8cf5b`](https://github.com/ljharb/es-errors/commit/6d8cf5bbb6f3f598d02cf6f30e468ba2caa8e143)
|
| 25 |
+
|
| 26 |
+
## [v1.1.0](https://github.com/ljharb/es-errors/compare/v1.0.0...v1.1.0) - 2024-02-04
|
| 27 |
+
|
| 28 |
+
### Commits
|
| 29 |
+
|
| 30 |
+
- [New] add base Error [`2983ab6`](https://github.com/ljharb/es-errors/commit/2983ab65f7bc5441276cb021dc3aa03c78881698)
|
| 31 |
+
|
| 32 |
+
## v1.0.0 - 2024-02-03
|
| 33 |
+
|
| 34 |
+
### Commits
|
| 35 |
+
|
| 36 |
+
- Initial implementation, tests, readme, type [`8f47631`](https://github.com/ljharb/es-errors/commit/8f476317e9ad76f40ad648081829b1a1a3a1288b)
|
| 37 |
+
- Initial commit [`ea5d099`](https://github.com/ljharb/es-errors/commit/ea5d099ef18e550509ab9e2be000526afd81c385)
|
| 38 |
+
- npm init [`6f5ebf9`](https://github.com/ljharb/es-errors/commit/6f5ebf9cead474dadd72b9e63dad315820a089ae)
|
| 39 |
+
- Only apps should have lockfiles [`e1a0aeb`](https://github.com/ljharb/es-errors/commit/e1a0aeb7b80f5cfc56be54d6b2100e915d47def8)
|
| 40 |
+
- [meta] add `sideEffects` flag [`a9c7d46`](https://github.com/ljharb/es-errors/commit/a9c7d460a492f1d8a241c836bc25a322a19cc043)
|
node_modules/es-errors/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2024 Jordan Harband
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
node_modules/es-errors/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# es-errors <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
| 2 |
+
|
| 3 |
+
[![github actions][actions-image]][actions-url]
|
| 4 |
+
[![coverage][codecov-image]][codecov-url]
|
| 5 |
+
[![License][license-image]][license-url]
|
| 6 |
+
[![Downloads][downloads-image]][downloads-url]
|
| 7 |
+
|
| 8 |
+
[![npm badge][npm-badge-png]][package-url]
|
| 9 |
+
|
| 10 |
+
A simple cache for a few of the JS Error constructors.
|
| 11 |
+
|
| 12 |
+
## Example
|
| 13 |
+
|
| 14 |
+
```js
|
| 15 |
+
const assert = require('assert');
|
| 16 |
+
|
| 17 |
+
const Base = require('es-errors');
|
| 18 |
+
const Eval = require('es-errors/eval');
|
| 19 |
+
const Range = require('es-errors/range');
|
| 20 |
+
const Ref = require('es-errors/ref');
|
| 21 |
+
const Syntax = require('es-errors/syntax');
|
| 22 |
+
const Type = require('es-errors/type');
|
| 23 |
+
const URI = require('es-errors/uri');
|
| 24 |
+
|
| 25 |
+
assert.equal(Base, Error);
|
| 26 |
+
assert.equal(Eval, EvalError);
|
| 27 |
+
assert.equal(Range, RangeError);
|
| 28 |
+
assert.equal(Ref, ReferenceError);
|
| 29 |
+
assert.equal(Syntax, SyntaxError);
|
| 30 |
+
assert.equal(Type, TypeError);
|
| 31 |
+
assert.equal(URI, URIError);
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
## Tests
|
| 35 |
+
Simply clone the repo, `npm install`, and run `npm test`
|
| 36 |
+
|
| 37 |
+
## Security
|
| 38 |
+
|
| 39 |
+
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
|
| 40 |
+
|
| 41 |
+
[package-url]: https://npmjs.org/package/es-errors
|
| 42 |
+
[npm-version-svg]: https://versionbadg.es/ljharb/es-errors.svg
|
| 43 |
+
[deps-svg]: https://david-dm.org/ljharb/es-errors.svg
|
| 44 |
+
[deps-url]: https://david-dm.org/ljharb/es-errors
|
| 45 |
+
[dev-deps-svg]: https://david-dm.org/ljharb/es-errors/dev-status.svg
|
| 46 |
+
[dev-deps-url]: https://david-dm.org/ljharb/es-errors#info=devDependencies
|
| 47 |
+
[npm-badge-png]: https://nodei.co/npm/es-errors.png?downloads=true&stars=true
|
| 48 |
+
[license-image]: https://img.shields.io/npm/l/es-errors.svg
|
| 49 |
+
[license-url]: LICENSE
|
| 50 |
+
[downloads-image]: https://img.shields.io/npm/dm/es-errors.svg
|
| 51 |
+
[downloads-url]: https://npm-stat.com/charts.html?package=es-errors
|
| 52 |
+
[codecov-image]: https://codecov.io/gh/ljharb/es-errors/branch/main/graphs/badge.svg
|
| 53 |
+
[codecov-url]: https://app.codecov.io/gh/ljharb/es-errors/
|
| 54 |
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-errors
|
| 55 |
+
[actions-url]: https://github.com/ljharb/es-errors/actions
|
node_modules/es-errors/eval.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const EvalError: EvalErrorConstructor;
|
| 2 |
+
|
| 3 |
+
export = EvalError;
|
node_modules/es-errors/eval.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('./eval')} */
|
| 4 |
+
module.exports = EvalError;
|
node_modules/es-errors/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const Error: ErrorConstructor;
|
| 2 |
+
|
| 3 |
+
export = Error;
|
node_modules/es-errors/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('.')} */
|
| 4 |
+
module.exports = Error;
|
node_modules/es-errors/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "es-errors",
|
| 3 |
+
"version": "1.3.0",
|
| 4 |
+
"description": "A simple cache for a few of the JS Error constructors.",
|
| 5 |
+
"main": "index.js",
|
| 6 |
+
"exports": {
|
| 7 |
+
".": "./index.js",
|
| 8 |
+
"./eval": "./eval.js",
|
| 9 |
+
"./range": "./range.js",
|
| 10 |
+
"./ref": "./ref.js",
|
| 11 |
+
"./syntax": "./syntax.js",
|
| 12 |
+
"./type": "./type.js",
|
| 13 |
+
"./uri": "./uri.js",
|
| 14 |
+
"./package.json": "./package.json"
|
| 15 |
+
},
|
| 16 |
+
"sideEffects": false,
|
| 17 |
+
"scripts": {
|
| 18 |
+
"prepack": "npmignore --auto --commentLines=autogenerated",
|
| 19 |
+
"prepublishOnly": "safe-publish-latest",
|
| 20 |
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
| 21 |
+
"pretest": "npm run lint",
|
| 22 |
+
"test": "npm run tests-only",
|
| 23 |
+
"tests-only": "nyc tape 'test/**/*.js'",
|
| 24 |
+
"posttest": "aud --production",
|
| 25 |
+
"prelint": "evalmd README.md",
|
| 26 |
+
"lint": "eslint --ext=js,mjs .",
|
| 27 |
+
"postlint": "tsc -p . && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)",
|
| 28 |
+
"version": "auto-changelog && git add CHANGELOG.md",
|
| 29 |
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
| 30 |
+
},
|
| 31 |
+
"repository": {
|
| 32 |
+
"type": "git",
|
| 33 |
+
"url": "git+https://github.com/ljharb/es-errors.git"
|
| 34 |
+
},
|
| 35 |
+
"keywords": [
|
| 36 |
+
"javascript",
|
| 37 |
+
"ecmascript",
|
| 38 |
+
"error",
|
| 39 |
+
"typeerror",
|
| 40 |
+
"syntaxerror",
|
| 41 |
+
"rangeerror"
|
| 42 |
+
],
|
| 43 |
+
"author": "Jordan Harband <ljharb@gmail.com>",
|
| 44 |
+
"license": "MIT",
|
| 45 |
+
"bugs": {
|
| 46 |
+
"url": "https://github.com/ljharb/es-errors/issues"
|
| 47 |
+
},
|
| 48 |
+
"homepage": "https://github.com/ljharb/es-errors#readme",
|
| 49 |
+
"devDependencies": {
|
| 50 |
+
"@ljharb/eslint-config": "^21.1.0",
|
| 51 |
+
"@types/tape": "^5.6.4",
|
| 52 |
+
"aud": "^2.0.4",
|
| 53 |
+
"auto-changelog": "^2.4.0",
|
| 54 |
+
"eclint": "^2.8.1",
|
| 55 |
+
"eslint": "^8.8.0",
|
| 56 |
+
"evalmd": "^0.0.19",
|
| 57 |
+
"in-publish": "^2.0.1",
|
| 58 |
+
"npmignore": "^0.3.1",
|
| 59 |
+
"nyc": "^10.3.2",
|
| 60 |
+
"safe-publish-latest": "^2.0.0",
|
| 61 |
+
"tape": "^5.7.4",
|
| 62 |
+
"typescript": "next"
|
| 63 |
+
},
|
| 64 |
+
"auto-changelog": {
|
| 65 |
+
"output": "CHANGELOG.md",
|
| 66 |
+
"template": "keepachangelog",
|
| 67 |
+
"unreleased": false,
|
| 68 |
+
"commitLimit": false,
|
| 69 |
+
"backfillLimit": false,
|
| 70 |
+
"hideCredit": true
|
| 71 |
+
},
|
| 72 |
+
"publishConfig": {
|
| 73 |
+
"ignore": [
|
| 74 |
+
".github/workflows"
|
| 75 |
+
]
|
| 76 |
+
},
|
| 77 |
+
"engines": {
|
| 78 |
+
"node": ">= 0.4"
|
| 79 |
+
}
|
| 80 |
+
}
|
node_modules/es-errors/range.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const RangeError: RangeErrorConstructor;
|
| 2 |
+
|
| 3 |
+
export = RangeError;
|
node_modules/es-errors/range.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('./range')} */
|
| 4 |
+
module.exports = RangeError;
|
node_modules/es-errors/ref.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const ReferenceError: ReferenceErrorConstructor;
|
| 2 |
+
|
| 3 |
+
export = ReferenceError;
|
node_modules/es-errors/ref.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('./ref')} */
|
| 4 |
+
module.exports = ReferenceError;
|
node_modules/es-errors/syntax.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const SyntaxError: SyntaxErrorConstructor;
|
| 2 |
+
|
| 3 |
+
export = SyntaxError;
|
node_modules/es-errors/syntax.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
/** @type {import('./syntax')} */
|
| 4 |
+
module.exports = SyntaxError;
|
node_modules/es-errors/test/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
var test = require('tape');
|
| 4 |
+
|
| 5 |
+
var E = require('../');
|
| 6 |
+
var R = require('../range');
|
| 7 |
+
var Ref = require('../ref');
|
| 8 |
+
var S = require('../syntax');
|
| 9 |
+
var T = require('../type');
|
| 10 |
+
|
| 11 |
+
test('errors', function (t) {
|
| 12 |
+
t.equal(E, Error);
|
| 13 |
+
t.equal(R, RangeError);
|
| 14 |
+
t.equal(Ref, ReferenceError);
|
| 15 |
+
t.equal(S, SyntaxError);
|
| 16 |
+
t.equal(T, TypeError);
|
| 17 |
+
|
| 18 |
+
t.end();
|
| 19 |
+
});
|
node_modules/es-errors/tsconfig.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"compilerOptions": {
|
| 3 |
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
| 4 |
+
|
| 5 |
+
/* Projects */
|
| 6 |
+
|
| 7 |
+
/* Language and Environment */
|
| 8 |
+
"target": "es5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
| 9 |
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
| 10 |
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
| 11 |
+
"useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
| 12 |
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
| 13 |
+
|
| 14 |
+
/* Modules */
|
| 15 |
+
"module": "commonjs", /* Specify what module code is generated. */
|
| 16 |
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
| 17 |
+
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
| 18 |
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
| 19 |
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
| 20 |
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
| 21 |
+
// "typeRoots": ["types"], /* Specify multiple folders that act like `./node_modules/@types`. */
|
| 22 |
+
"resolveJsonModule": true, /* Enable importing .json files. */
|
| 23 |
+
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
| 24 |
+
|
| 25 |
+
/* JavaScript Support */
|
| 26 |
+
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
| 27 |
+
"checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
| 28 |
+
"maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
| 29 |
+
|
| 30 |
+
/* Emit */
|
| 31 |
+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
| 32 |
+
"declarationMap": true, /* Create sourcemaps for d.ts files. */
|
| 33 |
+
"noEmit": true, /* Disable emitting files from a compilation. */
|
| 34 |
+
|
| 35 |
+
/* Interop Constraints */
|
| 36 |
+
"allowSyntheticDefaultImports": true, /* Allow `import x from y` when a module doesn't have a default export. */
|
| 37 |
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
|
| 38 |
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
| 39 |
+
|
| 40 |
+
/* Type Checking */
|
| 41 |
+
"strict": true, /* Enable all strict type-checking options. */
|
| 42 |
+
|
| 43 |
+
/* Completeness */
|
| 44 |
+
// "skipLibCheck": true /* Skip type checking all .d.ts files. */
|
| 45 |
+
},
|
| 46 |
+
"exclude": [
|
| 47 |
+
"coverage",
|
| 48 |
+
],
|
| 49 |
+
}
|