Skip to content

Commit

Permalink
fix(ui): is.deepEqual not working correctly for Map() or Set() #15248
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Jan 10, 2023
1 parent 2216a32 commit e21220e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions ui/src/utils/is.js
Expand Up @@ -32,20 +32,23 @@ export function isDeepEqual (a, b) {
return false
}

i = a.entries().next()
let iter = a.entries()

i = iter.next()
while (i.done !== true) {
if (b.has(i.value[ 0 ]) !== true) {
return false
}
i = i.next()
i = iter.next()
}

i = a.entries().next()
iter = a.entries()
i = iter.next()
while (i.done !== true) {
if (isDeepEqual(i.value[ 1 ], b.get(i.value[ 0 ])) !== true) {
return false
}
i = i.next()
i = iter.next()
}

return true
Expand All @@ -56,12 +59,14 @@ export function isDeepEqual (a, b) {
return false
}

i = a.entries().next()
const iter = a.entries()

i = iter.next()
while (i.done !== true) {
if (b.has(i.value[ 0 ]) !== true) {
return false
}
i = i.next()
i = iter.next()
}

return true
Expand Down

0 comments on commit e21220e

Please sign in to comment.