shallow-equal
shallow-equal copied to clipboard
fix: use same-value over strict-equality
-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 & @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!