Skip to content

Commit

Permalink
Fix another issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AsyncBanana committed Mar 19, 2024
1 parent b6a4a24 commit ca7fafd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,13 @@ export default function diff(
);
} else if (
objKey !== newObjKey &&
// treat NaN values as equivalent
!(Number.isNaN(objKey) && Number.isNaN(newObjKey)) &&
!(
// treat NaN values as equivalent
(
Number.isNaN(objKey) &&
Number.isNaN(newObjKey) &&
areCompatibleObjects &&
(isNaN(objKey)
? objKey + "" === newObjKey + ""
: +objKey === +newObjKey)
)
areCompatibleObjects &&
(isNaN(objKey)
? objKey + "" === newObjKey + ""
: +objKey === +newObjKey)
)
) {
diffs.push({
Expand Down

0 comments on commit ca7fafd

Please sign in to comment.