mattphillips / deep-object-diff

Deep diffs two objects, including nested structures of arrays and objects, and returns the difference. ❄️
https://www.npmjs.com/package/deep-object-diff
MIT License
1.05k stars 89 forks source link

Undefined value #54

Closed josinaldobarbosa closed 4 years ago

josinaldobarbosa commented 4 years ago

should that be undefined?

Original: [ { _id: 123, id_content: 111, id_category: 22 } ] New: [ { id_content: 111, id_category: 22 } ] detailedDiff/diff: { added: {}, deleted: { '0': { _id: undefined } }, updated: {} }

papb commented 4 years ago

Yes, this is the way this module works, it outputs the current value, since _id no longer exists, its current value resolves to undefined.

anko commented 4 years ago

Yep, I think that's the expected behaviour. The readme deletedDiff example works the same way.

josinaldobarbosa commented 4 years ago

ok, thanks guys