MCPcopy Create free account
hub / github.com/mdevils/html-entities / createHtml5DecodeMethods

Function createHtml5DecodeMethods

benchmark/benchmark.ts:47–60  ·  view source on GitHub ↗
(textToDecode: string)

Source from the content-addressed store, hash-verified

45}
46
47function createHtml5DecodeMethods(textToDecode: string) {
48 const strict: DecodeOptions = {level: 'html5', scope: 'strict'};
49 const body: DecodeOptions = {level: 'html5', scope: 'body'};
50 const attribute: DecodeOptions = {level: 'html5', scope: 'attribute'};
51 return {
52 'html-entities.decode - html5, strict': () => decode(textToDecode, strict),
53 'html-entities.decode - html5, body': () => decode(textToDecode, body),
54 'html-entities.decode - html5, attribute': () => decode(textToDecode, attribute),
55 '(old) Html5Entities.decode': () => html5Entities.decode(textToDecode),
56 'entities.decodeHTML': () => entities.decodeHTML(textToDecode),
57 'entities.decodeHTMLStrict': () => entities.decodeHTMLStrict(textToDecode),
58 'he.decode': () => he.decode(textToDecode)
59 };
60}
61
62function createHtml4EncodeMethods(textToEncode: string) {
63 const nonAsciiPrintable: EncodeOptions = {level: 'html4', mode: 'nonAsciiPrintable'};

Callers 1

benchmark.tsFile · 0.85

Calls 2

decodeFunction · 0.90
decodeMethod · 0.45

Tested by

no test coverage detected