Skip to content

Commit

Permalink
When diffing 2 objects, treat array properties as intrinsic objects a…
Browse files Browse the repository at this point in the history
…nd never go into them to treat array indices as if they were object props.

Resolves #1195.
  • Loading branch information
dfahlander committed Dec 16, 2020
1 parent 237e9f8 commit 7251bb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export const getValueOf = (val:any, type: string) =>
const bpTypeName = toStringTag(bp);

if (apTypeName === bpTypeName) {
if (intrinsicTypeNameSet[apTypeName]) {
if (intrinsicTypeNameSet[apTypeName] || isArray(ap)) {
// This is an intrinsic type. Don't go deep diffing it.
// Instead compare its value in best-effort:
// (Can compare real values of Date, ArrayBuffers and views)
Expand Down

0 comments on commit 7251bb3

Please sign in to comment.