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

Function createHtml4DecodeMethods

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

Source from the content-addressed store, hash-verified

72}
73
74function createHtml4DecodeMethods(textToDecode: string) {
75 const strict: DecodeOptions = {level: 'html4', scope: 'strict'};
76 const body: DecodeOptions = {level: 'html4', scope: 'body'};
77 const attribute: DecodeOptions = {level: 'html4', scope: 'attribute'};
78 return {
79 'html-entities.decode - html4, strict': () => decode(textToDecode, strict),
80 'html-entities.decode - html4, body': () => decode(textToDecode, body),
81 'html-entities.decode - html4, attribute': () => decode(textToDecode, attribute),
82 '(old) Html4Entities.decode': () => html4Entities.decode(textToDecode)
83 };
84}
85
86function createXmlEncodeMethods(textToEncode: string) {
87 const nonAsciiPrintable: EncodeOptions = {level: 'xml', mode: 'nonAsciiPrintable'};

Callers 1

benchmark.tsFile · 0.85

Calls 2

decodeFunction · 0.90
decodeMethod · 0.45

Tested by

no test coverage detected