This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

19
node_modules/html-entities/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,19 @@
Copyright (c) 2021 Dulin Marat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

217
node_modules/html-entities/README.md generated vendored Normal file
View File

@@ -0,0 +1,217 @@
html-entities
=============
Fastest HTML entities library.
Comes with both TypeScript and Flow types.
Installation
------------
```bash
$ npm install html-entities
```
Usage
-----
### encode(text, options)
Encodes text replacing HTML special characters (`<>&"'`) and/or other character ranges depending on `mode` option value.
```js
import {encode} from 'html-entities';
encode('< > " \' & © ∆');
// -> '&lt; &gt; &quot; &apos; &amp; © ∆'
encode('< ©', {mode: 'nonAsciiPrintable'});
// -> '&lt; &copy;'
encode('< ©', {mode: 'nonAsciiPrintable', level: 'xml'});
// -> '&lt; &#169;'
encode('< > " \' & ©', {mode: 'nonAsciiPrintableOnly', level: 'xml'});
// -> '< > " \' & &#169;'
```
Options:
#### level
* `all` alias to `html5` (default).
* `html5` uses `HTML5` named references.
* `html4` uses `HTML4` named references.
* `xml` uses `XML` named references.
#### mode
* `specialChars` encodes only HTML special characters (default).
* `nonAscii` encodes HTML special characters and everything outside the [ASCII character range](https://en.wikipedia.org/wiki/ASCII).
* `nonAsciiPrintable` encodes HTML special characters and everything outiside of the [ASCII printable characters](https://en.wikipedia.org/wiki/ASCII#Printable_characters).
* `nonAsciiPrintableOnly` everything outiside of the [ASCII printable characters](https://en.wikipedia.org/wiki/ASCII#Printable_characters) keeping HTML special characters intact.
* `extensive` encodes all non-printable characters, non-ASCII characters and all characters with named references.
#### numeric
* `decimal` uses decimal numbers when encoding html entities. i.e. `&#169;` (default).
* `hexadecimal` uses hexadecimal numbers when encoding html entities. i.e. `&#xa9;`.
### decode(text, options)
Decodes text replacing entities to characters. Unknown entities are left as is.
```js
import {decode} from 'html-entities';
decode('&lt; &gt; &quot; &apos; &amp; &#169; &#8710;');
// -> '< > " \' & © ∆'
decode('&copy;', {level: 'html5'});
// -> '©'
decode('&copy;', {level: 'xml'});
// -> '&copy;'
```
Options:
#### level
* `all` alias to `html5` (default).
* `html5` uses `HTML5` named references.
* `html4` uses `HTML4` named references.
* `xml` uses `XML` named references.
#### scope
* `body` emulates behavior of browser when parsing tag bodies: entities without semicolon are also replaced (default).
* `attribute` emulates behavior of browser when parsing tag attributes: entities without semicolon are replaced when not followed by equality sign `=`.
* `strict` ignores entities without semicolon.
### decodeEntity(text, options)
Decodes a single HTML entity. Unknown entitiy is left as is.
```js
import {decodeEntity} from 'html-entities';
decodeEntity('&lt;');
// -> '<'
decodeEntity('&copy;', {level: 'html5'});
// -> '©'
decodeEntity('&copy;', {level: 'xml'});
// -> '&copy;'
```
Options:
#### level
* `all` alias to `html5` (default).
* `html5` uses `HTML5` named references.
* `html4` uses `HTML4` named references.
* `xml` uses `XML` named references.
Performance
-----------
Statistically significant comparison with other libraries using `benchmark.js`.
Results by this library are marked with `*`.
The source code of the benchmark is available at `benchmark/benchmark.ts`.
```
Common
Initialization / Load speed
* #1: html-entities x 2,632,942 ops/sec ±3.71% (72 runs sampled)
#2: entities x 1,379,154 ops/sec ±5.87% (75 runs sampled)
#3: he x 1,334,035 ops/sec ±3.14% (83 runs sampled)
HTML5
Encode test
* #1: html-entities.encode - html5, nonAscii x 415,806 ops/sec ±0.73% (85 runs sampled)
* #2: html-entities.encode - html5, nonAsciiPrintable x 401,420 ops/sec ±0.35% (93 runs sampled)
#3: entities.encodeNonAsciiHTML x 401,235 ops/sec ±0.41% (88 runs sampled)
#4: entities.encodeHTML x 284,868 ops/sec ±0.45% (93 runs sampled)
* #5: html-entities.encode - html5, extensive x 237,613 ops/sec ±0.42% (93 runs sampled)
#6: he.encode x 91,459 ops/sec ±0.50% (84 runs sampled)
Decode test
#1: entities.decodeHTMLStrict x 614,920 ops/sec ±0.41% (89 runs sampled)
#2: entities.decodeHTML x 577,698 ops/sec ±0.44% (90 runs sampled)
* #3: html-entities.decode - html5, strict x 323,680 ops/sec ±0.39% (92 runs sampled)
* #4: html-entities.decode - html5, body x 297,548 ops/sec ±0.45% (91 runs sampled)
* #5: html-entities.decode - html5, attribute x 293,617 ops/sec ±0.37% (94 runs sampled)
#6: he.decode x 145,383 ops/sec ±0.36% (94 runs sampled)
HTML4
Encode test
* #1: html-entities.encode - html4, nonAscii x 379,799 ops/sec ±0.29% (96 runs sampled)
* #2: html-entities.encode - html4, nonAsciiPrintable x 350,003 ops/sec ±0.42% (92 runs sampled)
* #3: html-entities.encode - html4, extensive x 169,759 ops/sec ±0.43% (90 runs sampled)
Decode test
* #1: html-entities.decode - html4, attribute x 291,048 ops/sec ±0.42% (92 runs sampled)
* #2: html-entities.decode - html4, strict x 287,110 ops/sec ±0.56% (93 runs sampled)
* #3: html-entities.decode - html4, body x 285,529 ops/sec ±0.57% (93 runs sampled)
XML
Encode test
#1: entities.encodeXML x 418,561 ops/sec ±0.80% (90 runs sampled)
* #2: html-entities.encode - xml, nonAsciiPrintable x 402,868 ops/sec ±0.30% (89 runs sampled)
* #3: html-entities.encode - xml, nonAscii x 403,669 ops/sec ±7.87% (83 runs sampled)
* #4: html-entities.encode - xml, extensive x 237,766 ops/sec ±0.45% (93 runs sampled)
Decode test
#1: entities.decodeXML x 888,700 ops/sec ±0.48% (93 runs sampled)
* #2: html-entities.decode - xml, strict x 353,127 ops/sec ±0.40% (92 runs sampled)
* #3: html-entities.decode - xml, body x 355,796 ops/sec ±1.58% (86 runs sampled)
* #4: html-entities.decode - xml, attribute x 369,454 ops/sec ±8.74% (84 runs sampled)
Escaping
Escape test
#1: entities.escapeUTF8 x 1,308,013 ops/sec ±0.37% (91 runs sampled)
* #2: html-entities.encode - xml, specialChars x 1,258,760 ops/sec ±1.00% (93 runs sampled)
#3: he.escape x 822,569 ops/sec ±0.24% (94 runs sampled)
#4: entities.escape x 434,243 ops/sec ±0.34% (91 runs sampled)
```
License
-------
MIT
Security contact information
----------------------------
To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security). Tidelift will
coordinate the fix and disclosure.
`html-entities` for enterprise
------------------------------
Available as part of the Tidelift Subscription
The maintainers of `html-entities` and thousands of other packages are working with
Tidelift to deliver commercial support and maintenance for the open source
dependencies you use to build your applications. Save time, reduce risk, and
improve code health, while paying the maintainers of the exact dependencies you
use.
[Learn more.](https://tidelift.com/subscription/pkg/npm-html-entities?utm_source=npm-html-entities&utm_medium=referral&utm_campaign=enterprise)

20
node_modules/html-entities/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
export declare type Level = 'xml' | 'html4' | 'html5' | 'all';
interface CommonOptions {
level?: Level;
}
export declare type EncodeMode = 'specialChars' | 'nonAscii' | 'nonAsciiPrintable' | 'nonAsciiPrintableOnly' | 'extensive';
export interface EncodeOptions extends CommonOptions {
mode?: EncodeMode;
numeric?: 'decimal' | 'hexadecimal';
}
export declare type DecodeScope = 'strict' | 'body' | 'attribute';
export interface DecodeOptions extends CommonOptions {
scope?: DecodeScope;
}
/** Encodes all the necessary (specified by `level`) characters in the text */
export declare function encode(text: string | undefined | null, { mode, numeric, level }?: EncodeOptions): string;
/** Decodes a single entity */
export declare function decodeEntity(entity: string | undefined | null, { level }?: CommonOptions): string;
/** Decodes all entities in the text */
export declare function decode(text: string | undefined | null, { level, scope }?: DecodeOptions): string;
export {};

2
node_modules/html-entities/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:true});var named_references_1=require("./named-references");var numeric_unicode_map_1=require("./numeric-unicode-map");var surrogate_pairs_1=require("./surrogate-pairs");var allNamedReferences=__assign(__assign({},named_references_1.namedReferences),{all:named_references_1.namedReferences.html5});function replaceUsingRegExp(macroText,macroRegExp,macroReplacer){macroRegExp.lastIndex=0;var replaceMatch=macroRegExp.exec(macroText);var replaceResult;if(replaceMatch){replaceResult="";var replaceLastIndex=0;do{if(replaceLastIndex!==replaceMatch.index){replaceResult+=macroText.substring(replaceLastIndex,replaceMatch.index)}var replaceInput=replaceMatch[0];replaceResult+=macroReplacer(replaceInput);replaceLastIndex=replaceMatch.index+replaceInput.length}while(replaceMatch=macroRegExp.exec(macroText));if(replaceLastIndex!==macroText.length){replaceResult+=macroText.substring(replaceLastIndex)}}else{replaceResult=macroText}return replaceResult}var encodeRegExps={specialChars:/[<>'"&]/g,nonAscii:/[<>'"&\u0080-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,nonAsciiPrintable:/[<>'"&\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,nonAsciiPrintableOnly:/[\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,extensive:/[\x01-\x0c\x0e-\x1f\x21-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7d\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g};var defaultEncodeOptions={mode:"specialChars",level:"all",numeric:"decimal"};function encode(text,_a){var _b=_a===void 0?defaultEncodeOptions:_a,_c=_b.mode,mode=_c===void 0?"specialChars":_c,_d=_b.numeric,numeric=_d===void 0?"decimal":_d,_e=_b.level,level=_e===void 0?"all":_e;if(!text){return""}var encodeRegExp=encodeRegExps[mode];var references=allNamedReferences[level].characters;var isHex=numeric==="hexadecimal";return replaceUsingRegExp(text,encodeRegExp,(function(input){var result=references[input];if(!result){var code=input.length>1?surrogate_pairs_1.getCodePoint(input,0):input.charCodeAt(0);result=(isHex?"&#x"+code.toString(16):"&#"+code)+";"}return result}))}exports.encode=encode;var defaultDecodeOptions={scope:"body",level:"all"};var strict=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g;var attribute=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g;var baseDecodeRegExps={xml:{strict:strict,attribute:attribute,body:named_references_1.bodyRegExps.xml},html4:{strict:strict,attribute:attribute,body:named_references_1.bodyRegExps.html4},html5:{strict:strict,attribute:attribute,body:named_references_1.bodyRegExps.html5}};var decodeRegExps=__assign(__assign({},baseDecodeRegExps),{all:baseDecodeRegExps.html5});var fromCharCode=String.fromCharCode;var outOfBoundsChar=fromCharCode(65533);var defaultDecodeEntityOptions={level:"all"};function getDecodedEntity(entity,references,isAttribute,isStrict){var decodeResult=entity;var decodeEntityLastChar=entity[entity.length-1];if(isAttribute&&decodeEntityLastChar==="="){decodeResult=entity}else if(isStrict&&decodeEntityLastChar!==";"){decodeResult=entity}else{var decodeResultByReference=references[entity];if(decodeResultByReference){decodeResult=decodeResultByReference}else if(entity[0]==="&"&&entity[1]==="#"){var decodeSecondChar=entity[2];var decodeCode=decodeSecondChar=="x"||decodeSecondChar=="X"?parseInt(entity.substr(3),16):parseInt(entity.substr(2));decodeResult=decodeCode>=1114111?outOfBoundsChar:decodeCode>65535?surrogate_pairs_1.fromCodePoint(decodeCode):fromCharCode(numeric_unicode_map_1.numericUnicodeMap[decodeCode]||decodeCode)}}return decodeResult}function decodeEntity(entity,_a){var _b=(_a===void 0?defaultDecodeEntityOptions:_a).level,level=_b===void 0?"all":_b;if(!entity){return""}return getDecodedEntity(entity,allNamedReferences[level].entities,false,false)}exports.decodeEntity=decodeEntity;function decode(text,_a){var _b=_a===void 0?defaultDecodeOptions:_a,_c=_b.level,level=_c===void 0?"all":_c,_d=_b.scope,scope=_d===void 0?level==="xml"?"strict":"body":_d;if(!text){return""}var decodeRegExp=decodeRegExps[level][scope];var references=allNamedReferences[level].entities;var isAttribute=scope==="attribute";var isStrict=scope==="strict";return replaceUsingRegExp(text,decodeRegExp,(function(entity){return getDecodedEntity(entity,references,isAttribute,isStrict)}))}exports.decode=decode;
//# sourceMappingURL=./index.js.map

52
node_modules/html-entities/lib/index.js.flow generated vendored Normal file
View File

@@ -0,0 +1,52 @@
/**
* Flowtype definitions for index
* Generated by Flowgen from a Typescript Definition
* Flowgen v1.13.0
* @flow
*/
export type Level = "xml" | "html4" | "html5" | "all";
declare interface CommonOptions {
level?: Level;
}
export type EncodeMode =
| "specialChars"
| "nonAscii"
| "nonAsciiPrintable"
| "nonAsciiPrintableOnly"
| "extensive";
export type EncodeOptions = {
mode?: EncodeMode,
numeric?: "decimal" | "hexadecimal",
...
} & CommonOptions;
export type DecodeScope = "strict" | "body" | "attribute";
export type DecodeOptions = {
scope?: DecodeScope,
...
} & CommonOptions;
/**
* Encodes all the necessary (specified by `level`) characters in the text
*/
declare export function encode(
text: string | void | null,
x?: EncodeOptions
): string;
/**
* Decodes a single entity
*/
declare export function decodeEntity(
entity: string | void | null,
x?: CommonOptions
): string;
/**
* Decodes all entities in the text
*/
declare export function decode(
text: string | void | null,
x?: DecodeOptions
): string;
declare export {};

1
node_modules/html-entities/lib/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"./index.js.map","names":["named_references_1","require","numeric_unicode_map_1","surrogate_pairs_1","allNamedReferences","__assign","namedReferences","all","html5","replaceUsingRegExp","macroText","macroRegExp","macroReplacer","lastIndex","replaceMatch","exec","replaceResult","replaceLastIndex","index","substring","replaceInput","length","encodeRegExps","specialChars","nonAscii","nonAsciiPrintable","nonAsciiPrintableOnly","extensive","defaultEncodeOptions","mode","level","numeric","encode","text","_a","_b","_c","_d","_e","encodeRegExp","references","characters","isHex","input","result","code","getCodePoint","charCodeAt","toString","exports","defaultDecodeOptions","scope","strict","attribute","baseDecodeRegExps","xml","body","bodyRegExps","html4","decodeRegExps","fromCharCode","String","outOfBoundsChar","defaultDecodeEntityOptions","getDecodedEntity","entity","isAttribute","isStrict","decodeResult","decodeEntityLastChar","decodeResultByReference","decodeSecondChar","decodeCode","parseInt","substr","fromCodePoint","numericUnicodeMap","decodeEntity","entities","decode","decodeRegExp"],"sources":["../src/index.ts"],"mappings":"uUAAA,IAAAA,mBAAAC,QAAA,sBACA,IAAAC,sBAAAD,QAAA,yBACA,IAAAE,kBAAAF,QAAA,qBAEA,IAAMG,mBAAkBC,kBAAA,GACjBL,mBAAAM,iBAAe,CAClBC,IAAKP,mBAAAM,gBAAgBE,QAGzB,SAASC,mBAAmBC,UAAmBC,YAAqBC,eAChED,YAAYE,UAAY,EACxB,IAAIC,aAAeH,YAAYI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AAU,MAAO,MAC/E,CARA7B,QAAA4B,0BAWA,SAAgBE,OACZ9C,KACAC,I,IAAAC,GAAAD,UAAA,EAAAgB,qBAAAhB,GAACE,GAAAD,GAAAL,YAAAM,UAAA,QAAAA,GAAeC,GAAAF,GAAAgB,YAAAd,UAAA,EAAAP,QAAA,sBAAAO,GAEhB,IAAKJ,KAAM,CACP,MAAO,E,CAGX,IAAM+C,aAAerB,cAAc7B,OAAOqB,OAC1C,IAAMX,WAAapC,mBAAmB0B,OAAOgD,SAC7C,IAAMZ,YAAcf,QAAU,YAC9B,IAAMgB,SAAWhB,QAAU,SAE3B,OAAO1C,mBAAmBwB,KAAM+C,cAAc,SAACf,QAC3C,OAAAD,iBAAiBC,OAAQzB,WAAY0B,YAAaC,SAAlD,GAER,CAhBAlB,QAAA8B"}

2
node_modules/html-entities/lib/named-references.js generated vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.numericUnicodeMap={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};
//# sourceMappingURL=./numeric-unicode-map.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"./numeric-unicode-map.js.map","names":["exports","numericUnicodeMap"],"sources":["../src/numeric-unicode-map.ts"],"mappings":"sEAAaA,QAAAC,kBAA4C,CACrD,EAAG,MACH,IAAK,KACL,IAAK,KACL,IAAK,IACL,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,KACL,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,KACL,IAAK,IACL,IAAK,IACL,IAAK"}

2
node_modules/html-entities/lib/surrogate-pairs.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.fromCodePoint=String.fromCodePoint||function(astralCodePoint){return String.fromCharCode(Math.floor((astralCodePoint-65536)/1024)+55296,(astralCodePoint-65536)%1024+56320)};exports.getCodePoint=String.prototype.codePointAt?function(input,position){return input.codePointAt(position)}:function(input,position){return(input.charCodeAt(position)-55296)*1024+input.charCodeAt(position+1)-56320+65536};exports.highSurrogateFrom=55296;exports.highSurrogateTo=56319;
//# sourceMappingURL=./surrogate-pairs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"./surrogate-pairs.js.map","names":["exports","fromCodePoint","String","astralCodePoint","fromCharCode","Math","floor","getCodePoint","prototype","codePointAt","input","position","charCodeAt","highSurrogateFrom","highSurrogateTo"],"sources":["../src/surrogate-pairs.ts"],"mappings":"sEAAaA,QAAAC,cACTC,OAAOD,eACP,SAAUE,iBACN,OAAOD,OAAOE,aACVC,KAAKC,OAAOH,gBAAkB,OAAW,MAAS,OAChDA,gBAAkB,OAAW,KAAS,MAEhD,EAESH,QAAAO,aAAeL,OAAOM,UAAUC,YACvC,SAAUC,MAAeC,UACrB,OAAOD,MAAMD,YAAYE,SAC7B,EACA,SAAUD,MAAeC,UACrB,OAAQD,MAAME,WAAWD,UAAY,OAAU,KAAQD,MAAME,WAAWD,SAAW,GAAK,MAAS,KACrG,EAEOX,QAAAa,kBAAoB,MACpBb,QAAAc,gBAAkB"}

83
node_modules/html-entities/package.json generated vendored Normal file
View File

@@ -0,0 +1,83 @@
{
"name": "html-entities",
"version": "2.5.2",
"description": "Fastest HTML entities encode/decode library.",
"keywords": [
"html",
"html entities",
"html entities encode",
"html entities decode",
"entities",
"entities encode",
"entities decode"
],
"author": {
"name": "Marat Dulin",
"email": "mdevils@yandex.ru"
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/mdevils"
},
{
"type": "patreon",
"url": "https://patreon.com/mdevils"
}
],
"devDependencies": {
"@types/benchmark": "^2.1.0",
"@types/chai": "^4.2.11",
"@types/he": "^1.1.1",
"@types/mocha": "^7.0.2",
"@types/node": "^13.13.4",
"@typescript-eslint/eslint-plugin": "^4.6.1",
"@typescript-eslint/parser": "^4.6.1",
"benchmark": "^2.1.4",
"chai": "^4.2.0",
"entities": "^4.5.0",
"eslint": "^7.12.1",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.1.4",
"flowgen": "^1.13.0",
"he": "^1.2.0",
"husky": "^4.3.6",
"mocha": "^9.2.2",
"prettier": "^2.1.2",
"terser": "^5.6.1",
"ts-node": "^8.9.1",
"typescript": "^3.8.3"
},
"repository": {
"type": "git",
"url": "https://github.com/mdevils/html-entities.git"
},
"sideEffects": false,
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"types": "./lib/index.d.ts",
"scripts": {
"test": "mocha --recursive -r ts-node/register test/**/*.ts",
"test:watch": "mocha -w --recursive -r ts-node/register test/**/*.ts",
"test:lib": "TEST_LIB=1 npm run test",
"benchmark": "ts-node benchmark/benchmark",
"lint": "eslint src/**.ts",
"flow-type-gen": "flowgen --add-flow-header lib/index.d.ts -o lib/index.js.flow",
"remove-unused-declarations": "find lib -type f \\( -name '*.d.ts' ! -name index.d.ts \\) | xargs rm",
"minimize-lib-files": "cd lib && find . -type f \\( -name '*.js' \\) | while read fn; do terser --source-map \"content='$fn.map',filename='$fn.map',url='$fn.map'\" $fn -o $fn; done",
"build": "rm -Rf lib/* && tsc && npm run remove-unused-declarations && npm run flow-type-gen && npm run minimize-lib-files && npm run test:lib",
"prepublishOnly": "npm run build"
},
"files": [
"lib",
"src",
"LICENSE"
],
"husky": {
"hooks": {
"pre-commit": "npm run lint && npm run test"
}
},
"license": "MIT"
}

191
node_modules/html-entities/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,191 @@
import {bodyRegExps, namedReferences} from './named-references';
import {numericUnicodeMap} from './numeric-unicode-map';
import {fromCodePoint, getCodePoint} from './surrogate-pairs';
const allNamedReferences = {
...namedReferences,
all: namedReferences.html5
};
function replaceUsingRegExp(macroText: string, macroRegExp: RegExp, macroReplacer: (input: string) => string): string {
macroRegExp.lastIndex = 0;
let replaceMatch = macroRegExp.exec(macroText);
let replaceResult;
if (replaceMatch) {
replaceResult = '';
let replaceLastIndex = 0;
do {
if (replaceLastIndex !== replaceMatch.index) {
replaceResult += macroText.substring(replaceLastIndex, replaceMatch.index);
}
const replaceInput = replaceMatch[0];
replaceResult += macroReplacer(replaceInput);
replaceLastIndex = replaceMatch.index + replaceInput.length;
} while ((replaceMatch = macroRegExp.exec(macroText)));
if (replaceLastIndex !== macroText.length) {
replaceResult += macroText.substring(replaceLastIndex);
}
} else {
replaceResult = macroText;
}
return replaceResult;
}
export type Level = 'xml' | 'html4' | 'html5' | 'all';
interface CommonOptions {
level?: Level;
}
export type EncodeMode = 'specialChars' | 'nonAscii' | 'nonAsciiPrintable' | 'nonAsciiPrintableOnly' | 'extensive';
export interface EncodeOptions extends CommonOptions {
mode?: EncodeMode;
numeric?: 'decimal' | 'hexadecimal';
}
export type DecodeScope = 'strict' | 'body' | 'attribute';
export interface DecodeOptions extends CommonOptions {
scope?: DecodeScope;
}
const encodeRegExps: Record<EncodeMode, RegExp> = {
specialChars: /[<>'"&]/g,
nonAscii: /[<>'"&\u0080-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,
nonAsciiPrintable: /[<>'"&\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,
nonAsciiPrintableOnly: /[\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g,
extensive: /[\x01-\x0c\x0e-\x1f\x21-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7d\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g
};
const defaultEncodeOptions: EncodeOptions = {
mode: 'specialChars',
level: 'all',
numeric: 'decimal'
};
/** Encodes all the necessary (specified by `level`) characters in the text */
export function encode(
text: string | undefined | null,
{mode = 'specialChars', numeric = 'decimal', level = 'all'}: EncodeOptions = defaultEncodeOptions
) {
if (!text) {
return '';
}
const encodeRegExp = encodeRegExps[mode];
const references = allNamedReferences[level].characters;
const isHex = numeric === 'hexadecimal';
return replaceUsingRegExp(text, encodeRegExp, (input) => {
let result = references[input];
if (!result) {
const code = input.length > 1 ? getCodePoint(input, 0)! : input.charCodeAt(0);
result = (isHex ? '&#x' + code.toString(16) : '&#' + code) + ';';
}
return result;
});
}
const defaultDecodeOptions: DecodeOptions = {
scope: 'body',
level: 'all'
};
const strict = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g;
const attribute = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g;
const baseDecodeRegExps: Record<Exclude<Level, 'all'>, Record<DecodeScope, RegExp>> = {
xml: {
strict,
attribute,
body: bodyRegExps.xml
},
html4: {
strict,
attribute,
body: bodyRegExps.html4
},
html5: {
strict,
attribute,
body: bodyRegExps.html5
}
};
const decodeRegExps: Record<Level, Record<DecodeScope, RegExp>> = {
...baseDecodeRegExps,
all: baseDecodeRegExps.html5
};
const fromCharCode = String.fromCharCode;
const outOfBoundsChar = fromCharCode(65533);
const defaultDecodeEntityOptions: CommonOptions = {
level: 'all'
};
function getDecodedEntity(
entity: string,
references: Record<string, string>,
isAttribute: boolean,
isStrict: boolean
): string {
let decodeResult = entity;
const decodeEntityLastChar = entity[entity.length - 1];
if (isAttribute && decodeEntityLastChar === '=') {
decodeResult = entity;
} else if (isStrict && decodeEntityLastChar !== ';') {
decodeResult = entity;
} else {
const decodeResultByReference = references[entity];
if (decodeResultByReference) {
decodeResult = decodeResultByReference;
} else if (entity[0] === '&' && entity[1] === '#') {
const decodeSecondChar = entity[2];
const decodeCode =
decodeSecondChar == 'x' || decodeSecondChar == 'X'
? parseInt(entity.substr(3), 16)
: parseInt(entity.substr(2));
decodeResult =
decodeCode >= 0x10ffff
? outOfBoundsChar
: decodeCode > 65535
? fromCodePoint(decodeCode)
: fromCharCode(numericUnicodeMap[decodeCode] || decodeCode);
}
}
return decodeResult;
}
/** Decodes a single entity */
export function decodeEntity(
entity: string | undefined | null,
{level = 'all'}: CommonOptions = defaultDecodeEntityOptions
): string {
if (!entity) {
return '';
}
return getDecodedEntity(entity, allNamedReferences[level].entities, false, false);
}
/** Decodes all entities in the text */
export function decode(
text: string | undefined | null,
{level = 'all', scope = level === 'xml' ? 'strict' : 'body'}: DecodeOptions = defaultDecodeOptions
) {
if (!text) {
return '';
}
const decodeRegExp = decodeRegExps[level][scope];
const references = allNamedReferences[level].entities;
const isAttribute = scope === 'attribute';
const isStrict = scope === 'strict';
return replaceUsingRegExp(text, decodeRegExp, (entity) =>
getDecodedEntity(entity, references, isAttribute, isStrict)
);
}

4392
node_modules/html-entities/src/named-references.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

30
node_modules/html-entities/src/numeric-unicode-map.ts generated vendored Normal file
View File

@@ -0,0 +1,30 @@
export const numericUnicodeMap: Record<number, number> = {
0: 65533,
128: 8364,
130: 8218,
131: 402,
132: 8222,
133: 8230,
134: 8224,
135: 8225,
136: 710,
137: 8240,
138: 352,
139: 8249,
140: 338,
142: 381,
145: 8216,
146: 8217,
147: 8220,
148: 8221,
149: 8226,
150: 8211,
151: 8212,
152: 732,
153: 8482,
154: 353,
155: 8250,
156: 339,
158: 382,
159: 376
};

19
node_modules/html-entities/src/surrogate-pairs.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
export const fromCodePoint =
String.fromCodePoint ||
function (astralCodePoint: number) {
return String.fromCharCode(
Math.floor((astralCodePoint - 0x10000) / 0x400) + 0xd800,
((astralCodePoint - 0x10000) % 0x400) + 0xdc00
);
};
export const getCodePoint = String.prototype.codePointAt
? function (input: string, position: number) {
return input.codePointAt(position);
}
: function (input: string, position: number) {
return (input.charCodeAt(position) - 0xd800) * 0x400 + input.charCodeAt(position + 1) - 0xdc00 + 0x10000;
};
export const highSurrogateFrom = 0xd800;
export const highSurrogateTo = 0xdbff;