Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beautify(frag) {
let el
if (typeof frag === 'string') {
try {
el = xml.parse(frag)
} catch (err) {
return frag
}
} else {
el = frag
}
return xml.stringify(el, ' ')
}