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

Function createXmlEncodeMethods

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

Source from the content-addressed store, hash-verified

92}
93
94function createXmlEncodeMethods(textToEncode: string) {
95 const nonAsciiPrintable: EncodeOptions = {level: 'xml', mode: 'nonAsciiPrintable'};
96 const extensive: EncodeOptions = {level: 'xml', mode: 'extensive'};
97 const nonAscii: EncodeOptions = {level: 'xml', mode: 'nonAscii'};
98 return {
99 'html-entities.encode - xml, nonAscii': () => encode(textToEncode, nonAscii),
100 'html-entities.encode - xml, nonAsciiPrintable': () => encode(textToEncode, nonAsciiPrintable),
101 'html-entities.encode - xml, extensive': () => encode(textToEncode, extensive),
102 '(old) XmlEntities.encodeNonASCII': () => xmlEntities.encode(textToEncode),
103 'entities.encodeXML': () => entities.encodeXML(textToEncode)
104 };
105}
106
107function createXmlDecodeMethods(textToDecode: string) {
108 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…