Skip to content

Commit

Permalink
refactor: Use for..of instead of C-style for (#2374)
Browse files Browse the repository at this point in the history
  • Loading branch information
onlined authored Feb 29, 2024
1 parent 16b0ebf commit 41924df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vanilla/shallow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export function shallow<T>(objA: T, objB: T) {
if (keysA.length !== Object.keys(objB).length) {
return false
}
for (let i = 0; i < keysA.length; i++) {
for (const keyA of keysA) {
if (
!Object.prototype.hasOwnProperty.call(objB, keysA[i] as string) ||
!Object.is(objA[keysA[i] as keyof T], objB[keysA[i] as keyof T])
!Object.prototype.hasOwnProperty.call(objB, keyA as string) ||
!Object.is(objA[keyA as keyof T], objB[keyA as keyof T])
) {
return false
}
Expand Down

0 comments on commit 41924df

Please sign in to comment.