flitbit / diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Diffing identical objects returns undefined

BenStorey opened this issue · comments

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

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.