We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description Basic diff functionality seems to be broken.
const detailedDiff = require("deep-object-diff").detailedDiff; const lhs = { 'a': 1, 'b': 2 }; const rhs = { 'a': 1 }; diff = detailedDiff(lhs, rhs); console.log(JSON.stringify(diff, null, 2));
// Expected { "added": {}, "deleted": { "b": 2 }, "updated": {} }
// Actual { "added": {}, "deleted": {}, "updated": {} }
https://repl.it/repls/ThankfulFumblingOpenlook
The text was updated successfully, but these errors were encountered:
Hey @nhandyal the problem you are seeing is because of JSON.stringify which strips out any undefined values.
JSON.stringify
undefined
undefined is used to represent the value that has been deleted, or rather is now undefined.
If you try this it should work as expected:
const detailedDiff = require("deep-object-diff").detailedDiff; const lhs = { 'a': 1, 'b': 2 }; const rhs = { 'a': 1 }; console.log(detailedDiff(lhs, rhs));
Sorry, something went wrong.
No branches or pull requests
Description
Basic diff functionality seems to be broken.
https://repl.it/repls/ThankfulFumblingOpenlook
The text was updated successfully, but these errors were encountered: