Skip to content

Commit 156ba3b

Browse files
authored
Update loose-equal.js
1 parent bf2b9fa commit 156ba3b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/utils/loose-equal.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { keys } from './object'
1+
import { hasOwnProperty, keys } from './object'
22
import { isArray, isDate, isObject } from './inspect'
33

44
// Assumes both a and b are arrays!
@@ -46,10 +46,8 @@ const looseEqual = (a, b) => {
4646
return false
4747
}
4848
for (const key in a) {
49-
// eslint-disable-next-line no-prototype-builtins
50-
const aHasKey = a.hasOwnProperty(key)
51-
// eslint-disable-next-line no-prototype-builtins
52-
const bHasKey = b.hasOwnProperty(key)
49+
const aHasKey = hasOwnProperty(a, key)
50+
const bHasKey = hasOwnProperty(b, key)
5351
if ((aHasKey && !bHasKey) || (!aHasKey && bHasKey) || !looseEqual(a[key], b[key])) {
5452
return false
5553
}

0 commit comments

Comments
 (0)