Skip to content
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

A better way to test for changes #97

Open
robcdd opened this issue Jun 2, 2023 · 0 comments
Open

A better way to test for changes #97

robcdd opened this issue Jun 2, 2023 · 0 comments

Comments

@robcdd
Copy link

robcdd commented Jun 2, 2023

https://github.com/mattphillips/deep-object-diff/blob/a24d61fea6d6d644fc3e32a853f685953d6d5b41/src/added.js#LL5C1-L5C1

  if (lhs === rhs || !isObject(lhs) || !isObject(rhs)) return {};

If we could return null here, so that in detailedDiff we could receive added: null, it would be very easy to see that nothing was added. Currently is seems that we have to use Object.keys(diff.added).length to find out if anything was added. Same for deleted and updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant