Skip to content

Commit ca7fafd

Browse files
committed
Fix another issue
1 parent b6a4a24 commit ca7fafd

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

index.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,13 @@ export default function diff(
7272
);
7373
} else if (
7474
objKey !== newObjKey &&
75+
// treat NaN values as equivalent
76+
!(Number.isNaN(objKey) && Number.isNaN(newObjKey)) &&
7577
!(
76-
// treat NaN values as equivalent
77-
(
78-
Number.isNaN(objKey) &&
79-
Number.isNaN(newObjKey) &&
80-
areCompatibleObjects &&
81-
(isNaN(objKey)
82-
? objKey + "" === newObjKey + ""
83-
: +objKey === +newObjKey)
84-
)
78+
areCompatibleObjects &&
79+
(isNaN(objKey)
80+
? objKey + "" === newObjKey + ""
81+
: +objKey === +newObjKey)
8582
)
8683
) {
8784
diffs.push({

0 commit comments

Comments
 (0)