shallow-equal icon indicating copy to clipboard operation
shallow-equal copied to clipboard

fix: use same-value over strict-equality

Open eps1lon opened this issue 6 years ago • 1 comments

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

eps1lon avatar Feb 10 '20 11:02 eps1lon

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

fivecar avatar Jan 14 '23 18:01 fivecar