jsondiffpatch icon indicating copy to clipboard operation
jsondiffpatch copied to clipboard

[Question] Is there a way to return the difference?

Open mb8z opened this issue 6 years ago • 0 comments

Is there a way to return just the difference between two objects, so when I have two objects (just as example) that looks like this:

const source = { name: 'My name', street: 'My street', interest: 'football' };
const compareTo = { name: 'Other name', street: undefined, interest: 'football' };

I would get a return object that looks like this:

const result = { name: 'Other name', street: undefined };

mb8z avatar Aug 01 '18 14:08 mb8z