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

Function createXmlEncodeMethods

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

Source from the content-addressed store, hash-verified

84}
85
86function createXmlEncodeMethods(textToEncode: string) {
87 const nonAsciiPrintable: EncodeOptions = {level: 'xml', mode: 'nonAsciiPrintable'};
88 const extensive: EncodeOptions = {level: 'xml', mode: 'extensive'};
89 const nonAscii: EncodeOptions = {level: 'xml', mode: 'nonAscii'};
90 return {
91 'html-entities.encode - xml, nonAscii': () => encode(textToEncode, nonAscii),
92 'html-entities.encode - xml, nonAsciiPrintable': () => encode(textToEncode, nonAsciiPrintable),
93 'html-entities.encode - xml, extensive': () => encode(textToEncode, extensive),
94 '(old) XmlEntities.encodeNonASCII': () => xmlEntities.encode(textToEncode),
95 'entities.encodeXML': () => entities.encodeXML(textToEncode)
96 };
97}
98
99function createXmlDecodeMethods(textToDecode: string) {
100 const strict: DecodeOptions = {level: 'xml', scope: 'strict'};

Callers 1

benchmark.tsFile · 0.85

Calls 2

encodeFunction · 0.90
encodeMethod · 0.45

Tested by

no test coverage detected