Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const appendNode = (mutation: addedNodeMutation) => {
const parent = mirror.getNode(mutation.parentId);
if (!parent) {
return queue.push(mutation);
}
const target = buildNodeWithSN(
mutation.node,
this.iframe.contentDocument!,
mirror.map,
true,
) as Node;
let previous: Node | null = null;
let next: Node | null = null;
if (mutation.previousId) {
previous = mirror.getNode(mutation.previousId) as Node;
}
if (mutation.nextId) {
next = mirror.getNode(mutation.nextId) as Node;
}
if (mutation.previousId === -1 || mutation.nextId === -1) {
missingNodeMap[mutation.node.id] = {