microdiff icon indicating copy to clipboard operation
microdiff copied to clipboard

support for NaN values

Open brainthinks opened this issue 4 years ago • 0 comments

Currently, NaN values always result in CHANGE, even though nothing changed. Technically in JS, NaN !== NaN, so I understand that there is an argument for this behavior. However, I think that having a CHANGE entry on EVERY diff when an object contains NaN is noise, and therefore unexpected / undesirable behavior.

I propose treating NaN values as equivalent, resulting in the following:

diff({ testNaN: NaN }, { testNaN: NaN }) === [] // true

brainthinks avatar Jan 11 '22 19:01 brainthinks