Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.getXmlRootTag = function(xml) {
const traversal = xmlParser.getTraversalObj(xml.toString());
const [[root]] = Object.values(traversal.child);
return root && root.tagname;
};
function xmlToJson(result) {
var options = {
attrPrefix : "@_",
textNodeName : "#text",
ignoreNonTextNodeAttr : true,
ignoreTextNodeAttr : true,
ignoreNameSpace : true,
ignoreRootElement : false,
textNodeConversion : true,
textAttrConversion : false,
arrayMode : false
}
var tObj = fastXmlParser.getTraversalObj(result,options)
var jsonObj = fastXmlParser.convertToJson(tObj)
return jsonObj
}
exports = module.exports = {