Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
diffs.forEach(([ action, string ]) => {
if (action === diff.EQUAL) change.retain(string.length);
else if (action === diff.DELETE) change.delete(string.length);
else if (action === diff.INSERT) {
change.insert(string, editor.activeFormats);
}
});
change.chop();