Skip to content

Commit

Permalink
Fix object comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
stirante committed Jun 21, 2023
1 parent af03b00 commit 6b7b0df
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jsonte/types/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,18 @@ func IsEqualObject(a, b utils.NavigableMap[string, JsonType]) bool {
return false
}
for _, k := range a.Keys() {
if !b.ContainsKey(k) {
return false
}
if !b.Get(k).Equals(a.Get(k)) {
return false
}
}
for _, k := range b.Keys() {
if !a.ContainsKey(k) {
return false
}
}
return true
}

Expand Down

0 comments on commit 6b7b0df

Please sign in to comment.