deep-object-diff icon indicating copy to clipboard operation
deep-object-diff copied to clipboard

A better way to test for changes

Open robcdd opened this issue 2 years ago • 0 comments

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.

robcdd avatar Jun 02 '23 22:06 robcdd