-
-
Notifications
You must be signed in to change notification settings - Fork 96
detailedDiff returning confusing data #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you post a minimal example of runnable code that demonstrates the problem? I tried this— const { detailedDiff } = require('deep-object-diff')
const prev = { '....-01-01': ['Happy new year!'] }
const next = { '-01-01': ['Happy new year!'] }
console.log(detailedDiff(prev, next)) —and its output seems correct:
I also tried the same snippet as above but copy-pasted your objects. I got this output, which also seems correct logically, but it's very different from your result:
|
here you go... remove the .txt on all three testdiff.js.txt
added, but not deleted, altho something was |
Thanks for the example. I think I see what's going on now.
If you must get the diff output into JSON format specifically, you'll have to transform it such that If you don't need valid JSON but just want to turn the object into a representative string for debugging purposes, consider |
I guess the point is that the OLD object DOES have the definition.. so it shouldn't be undefined.. |
Every value in the I think |
working as designed, but not right.. |
i look at the results of the diff and see
I compare against an object like that, and get not equal.
I json.stringify() the object and it looks the same
I check the number of keys in each section and see some number of keys in one of more areas (usually deleted)
but those keys are not in the object being compared.
BUT
I compare this object (old)
against this (new)
and get this
but deleted is incomplete
"....-01-01" is not there
note this text is presented by JSON.stringify() on the objects..
The text was updated successfully, but these errors were encountered: