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

Function createHtml4EncodeMethods

benchmark/benchmark.ts:62–72  ·  view source on GitHub ↗
(textToEncode: string)

Source from the content-addressed store, hash-verified

60}
61
62function createHtml4EncodeMethods(textToEncode: string) {
63 const nonAsciiPrintable: EncodeOptions = {level: 'html4', mode: 'nonAsciiPrintable'};
64 const extensive: EncodeOptions = {level: 'html4', mode: 'extensive'};
65 const nonAscii: EncodeOptions = {level: 'html4', mode: 'nonAscii'};
66 return {
67 'html-entities.encode - html4, nonAscii': () => encode(textToEncode, nonAscii),
68 'html-entities.encode - html4, nonAsciiPrintable': () => encode(textToEncode, nonAsciiPrintable),
69 'html-entities.encode - html4, extensive': () => encode(textToEncode, extensive),
70 '(old) Html4Entities.encodeNonASCII': () => html4Entities.encodeNonASCII(textToEncode)
71 };
72}
73
74function createHtml4DecodeMethods(textToDecode: string) {
75 const strict: DecodeOptions = {level: 'html4', scope: 'strict'};

Callers 1

benchmark.tsFile · 0.85

Calls 2

encodeFunction · 0.90
encodeNonASCIIMethod · 0.45

Tested by

no test coverage detected