Fix for XML Formatting Options

This commit is contained in:
pedward99 2023-10-02 10:39:29 -04:00
parent 95532102ba
commit d63e7371fe

View File

@ -51,12 +51,12 @@ export const safeStringifyJSON = (obj, indent = false) => {
}
};
export const safeParseXML = (str) => {
export const safeParseXML = (str, options) => {
if (!str || !str.length || typeof str !== 'string') {
return str;
}
try {
return xmlFormat(str);
return xmlFormat(str, options);
} catch (e) {
return str;
}