mattphillips / deep-object-diff

Deep diffs two objects, including nested structures of arrays and objects, and returns the difference. ❄️
https://www.npmjs.com/package/deep-object-diff
MIT License
1.05k stars 89 forks source link

JSON.stringify will omit deleted keys in the result because they are set to undefined #78

Open jchip opened 2 years ago

jchip commented 2 years ago

When you JSON.stringify an object, it omit keys that has undefined value.

That means for the result coming back from deletedDiff needs a replacer for JSON.stringify to keep the key.

It's a small thing, but if you were not aware of it, like I did, you get tripped by it.

avimar commented 2 years ago

Sounds like #10 with a solution: https://github.com/mattphillips/deep-object-diff/issues/10#issuecomment-308224665

As referenced from https://github.com/mattphillips/deep-object-diff/issues/76#issuecomment-1048090047

gregfenton commented 1 year ago

Can this be closed now?