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

fix: use same-value over strict-equality #17

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

eps1lon
Copy link

@eps1lon eps1lon commented Feb 10, 2020

-shallowEqualArrays([+0, -0]) === true;
+shallowEqualArrays([+0, -0]) === false;

-shallowEqualArrays([NaN, 0/0]) === false;
+shallowEqualArrays([NaN, 0/0]) === true;

I'm trying to replace shallow-equal from fbjs which uses Object.is instead of ===. It looks like this package is mostly used in the react ecosystem so it seems relatively safe to switch to same-value comparison.

src/arrays.js Outdated Show resolved Hide resolved
@fivecar
Copy link
Collaborator

fivecar commented Jan 14, 2023

@eps1lon & @TrySound : I'm many years late to the party here, but is this change still worth taking? If so, I'd change the default comparator used in #34 (née #2) to instead use the inlined object-is proposed in this PR. LMK!

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

Successfully merging this pull request may close these issues.

None yet

3 participants