mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
refactor: Switch to Object.hasOwn (#2365)
This commit is contained in:
parent
bfea65a711
commit
ffbf675bdb
@ -39,7 +39,7 @@ export function shallow<T>(objA: T, objB: T) {
|
||||
}
|
||||
for (let i = 0; i < keysA.length; i++) {
|
||||
if (
|
||||
!Object.prototype.hasOwnProperty.call(objB, keysA[i] as string) ||
|
||||
!Object.hasOwn(objB, keysA[i] as string) ||
|
||||
!Object.is(objA[keysA[i] as keyof T], objB[keysA[i] as keyof T])
|
||||
) {
|
||||
return false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user