Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function error(literals, substitutions) {
let s = ''
for (let i = 0; i < substitutions.length; i++) {
s += literals[i]
s += escapeXML(substitutions[i])
}
s += literals[literals.length - 1]
return new Parser.XMLError(s)
}
str = str.trim()
if (str) {
element.t(str)
}
}
}
parser.onEndElement = (el, length) => {
if (length === 1) {
tree = el
}
}
for (i = 0; i < substitutions.length; i++) {
parser.write(literals[i])
parser.write(escapeXML(substitutions[i]))
}
parser.end(literals[literals.length - 1])
return tree
}