Skip to content

Commit 239db02

Browse files
authored
Merge pull request #187 from thasner/patch-1
Account for `NaN === NaN` evaluating to `false`
2 parents bda92c6 + 7acc3e9 commit 239db02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = function shallowEqual(objA, objB, compare, compareContext) {
77
return !!ret;
88
}
99

10-
if (objA === objB) {
10+
if (Object.is(objA, objB)) {
1111
return true;
1212
}
1313

@@ -37,7 +37,7 @@ module.exports = function shallowEqual(objA, objB, compare, compareContext) {
3737

3838
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
3939

40-
if (ret === false || (ret === void 0 && valueA !== valueB)) {
40+
if (ret === false || (ret === void 0 && !Object.is(valueA, valueB))) {
4141
return false;
4242
}
4343
}

0 commit comments

Comments
 (0)