Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const value = (target as HTMLElement).getAttribute(attributeName!);
if (isBlocked(target, blockClass) || value === oldValue) {
return;
}
let item: attributeCursor | undefined = attributes.find(
a => a.node === target,
);
if (!item) {
item = {
node: target,
attributes: {},
};
attributes.push(item);
}
// overwrite attribute if the mutations was triggered in same time
item.attributes[attributeName!] = transformAttribute(
document,
attributeName!,
value!,
);
break;
}
case 'childList': {
addedNodes.forEach(n => genAdds(n, target));
removedNodes.forEach(n => {
const nodeId = mirror.getId(n as INode);
const parentId = mirror.getId(target as INode);
if (isBlocked(n, blockClass)) {
return;
}
// removed node has not been serialized yet, just remove it from the Set
if (addedSet.has(n)) {