Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const childChanges = itemDiff.modified.forEach(change => {
const changeName = change[itemKey];
const before = prev.find(c => c[itemKey] === changeName)
const after = current.find(c => c[itemKey] === changeName)
const jd = justDiff(before, after);
// resolve the path
jd.forEach(jdOp => {
// Don't need to resolve paths for 'add' because we already know the name
if (jdOp.op === 'add') return;
jdOp.path = this.resolvePath(jdOp.path, before);
});
change.childChanges = jd;
});
return itemDiff;