We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf2b9fa commit 156ba3bCopy full SHA for 156ba3b
src/utils/loose-equal.js
@@ -1,4 +1,4 @@
1
-import { keys } from './object'
+import { hasOwnProperty, keys } from './object'
2
import { isArray, isDate, isObject } from './inspect'
3
4
// Assumes both a and b are arrays!
@@ -46,10 +46,8 @@ const looseEqual = (a, b) => {
46
return false
47
}
48
for (const key in a) {
49
- // eslint-disable-next-line no-prototype-builtins
50
- const aHasKey = a.hasOwnProperty(key)
51
52
- const bHasKey = b.hasOwnProperty(key)
+ const aHasKey = hasOwnProperty(a, key)
+ const bHasKey = hasOwnProperty(b, key)
53
if ((aHasKey && !bHasKey) || (!aHasKey && bHasKey) || !looseEqual(a[key], b[key])) {
54
55
0 commit comments