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

DeepDiff({ foo: undefined }, { foo: undefined }) reports a difference #98

Closed tylercallahan closed 7 years ago

tylercallahan commented 7 years ago

This behavior changed in v0.3.6 (likely this commit).

DeepDiff({ foo: undefined }, { foo: undefined })

returns: 0.3.5: undefined 0.3.6: [{"kind":"D","path":["foo"]}]

Expected: I believe this should not report a difference.

flitbit commented 7 years ago

Do you care to take a shot at a PR?

At or around line 150 there needs to be a test to see if key is defined on the right-hand-side: rhs.hasOwnProperty(key)... or something like that.

A regression test in test.js would be nice too.

If you don't have time to contribute, I'll get to it soon.

sberan commented 7 years ago

🌤 ▶️ I have a PR here: https://github.com/flitbit/diff/pull/99

flitbit commented 7 years ago

Fixed with PR #99