Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var paths = xml.getElementsByTagName("path")
for (i = 0; i < paths.length; i++) {
if ((d.value.preserveWhite) && (paths[i].getAttribute("fill") == '#fff')) {
//paths[i].setAttribute("fill", d.value.replaceWhite)
} else if ((d.value.iconFill) && (paths[i].getAttribute("fill") != 'none')) {
paths[i].setAttribute("fill", d.value.iconFill)
}
if ((d.value.iconStroke) && (paths[i].getAttribute("stroke") != 'none')) {
paths[i].setAttribute("stroke", d.value.iconStroke)
}
if ((d.value.iconStrokeWidth) && (paths[i].getAttribute("stroke-width"))) {
paths[i].setAttribute("stroke-width", d.value.iconStrokeWidth)
}
}
const frag = new jsdom9.jsdom(xml.documentElement.outerHTML) // fix for imported is not a NodeImpl
const newSvg = frag.getElementsByTagName("svg")[0]
cell.insertBefore(newSvg, cellText)
}