Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let nodes = [];
switch (mutation.type) {
case MUTATION.CHARACTER_DATA:
nodes.push(mutation.target);
break;
case MUTATION.NODES_CHANGED:
forEach(mutation.addedNodes, n => nodes.push(n));
if (mutation.removedNodes.length) {
nodes.push(mutation.target);
}
break;
}
let element = this.editor.element;
let attachedNodes = filter(nodes, node => containsNode(element, node));
return attachedNodes;
}
_trigger(context, type, event) {
forEach(
filter(this._listeners, ([_context, _type]) => {
return _context === context && _type === type;
}),
([context,, listener]) => {
listener.call(context, event);
}
);
}