Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const handleNodes = (nodes: Element[]) => {
const { classes, ids, hrefs } = extractFeaturesFromDOM(nodes);
const newIds: string[] = [];
const newClasses: string[] = [];
const newHrefs: string[] = [];
// Update ids
for (let i = 0; i < ids.length; i += 1) {
const id = ids[i];
if (knownIds.has(id) === false) {
newIds.push(id);
knownIds.add(id);
}
}
for (let i = 0; i < classes.length; i += 1) {
const cls = classes[i];
if (knownClasses.has(cls) === false) {
const handleNodes = (nodes: Element[]) => {
const { classes, ids, hrefs } = extractFeaturesFromDOM(nodes);
const newIds: string[] = [];
const newClasses: string[] = [];
const newHrefs: string[] = [];
// Update ids
for (let i = 0; i < ids.length; i += 1) {
const id = ids[i];
if (knownIds.has(id) === false) {
newIds.push(id);
knownIds.add(id);
}
}
for (let i = 0; i < classes.length; i += 1) {
const cls = classes[i];
if (knownClasses.has(cls) === false) {