Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getInnerTextLength(node) {
// ignore style, script, pre, textarea elements
if (sensitive.indexOf(node.tagName) !== -1) {
return 0
}
if (!node.children || !node.children.length) {
return 0
}
var child = node.children[0]
if (child.type === 'text' || child.type === 'comment') {
return child.value.split('\n')[0].length
}
return 0
}
function ignore(nodes) {
let index = nodes.length
while (index--) {
if (sensitive.indexOf(nodes[index].tagName) !== -1) {
return true
}
}
return false
}