Closed LAITONEN closed 6 years ago
Hey @LAITONEN which version of deep-object-diff are using to see this issue?
I've tried to reproduce it but can't seem to, would you mind creating a repo with an example of the issue?
Here's what I get when I try to reproduce using v1.1.0:
Ah just seen you have closed this so I assume its working :smile:
@mattphillips I resolved my issue, but, actually, there is an improvement that I would like to propose. The problem was that in one case subObj === undefined
, in another subObj === {}
. This caused diff to assume that the change has occurred.
Do you think this should be considered as "no change"?
Hey, I think it’s correct that they are treated as being different as dod doesn’t place any bias on the values supplied and fundamentally an object is a different value to undefined
If I pass the same object, which nests another object with no properties as a child, as both arguments of diff or detailedDiff, it will show that the change occurred and the change is an empty object.
In my application I needed to do this to circumvent the issue:
P.S. With detailedDiff this kind of 'change' is counted as "added".