deep-object-diff icon indicating copy to clipboard operation
deep-object-diff copied to clipboard

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

Open jchip opened this issue 3 years ago • 2 comments

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.

jchip avatar Feb 25 '22 18:02 jchip

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

avimar avatar Mar 28 '22 10:03 avimar

Can this be closed now?

gregfenton avatar Aug 15 '23 01:08 gregfenton