flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.
MIT License
2.99k stars 213 forks source link

diff does not return 'path' key #181

Open markatango opened 2 years ago

markatango commented 2 years ago

Documentation says: `v 0.2.0 and above The code snippet above would result in the following structure describing the differences:

[ { kind: 'E', path: [ 'name' ], lhs: 'my object', rhs: 'updated object' }, ... Butpath` key is actually not present in the result.

markatango commented 2 years ago

Apparently, deep-diff returns a 'D' type and path element if rhs is {}. But it returns an 'E" type and no path element if rhs is null. I think rhs is null should also return a 'D' type with path element. If lhs is {} d-d returns 'N' type with path element. But, if lhs is null, d-d also returns an 'E' type with no path element. Should be 'N' type with path.