Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for NaN values #23

Closed
brainthinks opened this issue Jan 11, 2022 · 1 comment
Closed

support for NaN values #23

brainthinks opened this issue Jan 11, 2022 · 1 comment

Comments

@brainthinks
Copy link
Contributor

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
@AsyncBanana
Copy link
Owner

Fixed in 1.4.0

@AsyncBanana AsyncBanana unpinned this issue Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants