refactor: Switch to Object.hasOwn (#2365)

This commit is contained in:
Ekin Dursun 2024-02-29 04:06:41 +03:00 committed by GitHub
parent bfea65a711
commit ffbf675bdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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