Skip to content

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.

@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.

3 participants