flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.
MIT License
2.99k stars 213 forks source link

Diffing identical objects returns undefined #180

Closed BenStorey closed 7 months ago

BenStorey commented 2 years ago

Surely it should return an empty list? To indicate no changes?

I iterate over the result so it seems strange I need to check for undefined here at all.

Thanks

cerebralkungfu commented 7 months ago

Yeah, that's my thinking today, but not at the time I wrote the library. It is working as designed but will change in v2.x, which uses generators/iterators, so works more naturally with your case.