MCPcopy Create free account
hub / github.com/NaturalIntelligence/fast-xml-parser / callback

Function callback

src/cli/cli.js:51–65  ·  view source on GitHub ↗
(xmlData)

Source from the content-addressed store, hash-verified

49 }
50
51 const callback = function(xmlData) {
52 let output = '';
53 if (validateOnly) {
54 output = XMLValidator.validate(xmlData);
55 process.exitCode = output === true ? 0 : 1;
56 } else {
57 const parser = new XMLParser(options);
58 output = JSON.stringify(parser.parse(xmlData,validate), null, 4);
59 }
60 if (outputFileName) {
61 writeToFile(outputFileName, output);
62 } else {
63 console.log(output);
64 }
65 };
66
67
68 try {

Callers 2

cli.jsFile · 0.85
readToEndMethod · 0.85

Calls 2

parseMethod · 0.95
writeToFileFunction · 0.85

Tested by

no test coverage detected