fix: add prefer-for-of rule (#5121)

This commit is contained in:
LongYinan
2023-11-29 04:44:21 +00:00
parent acf2de813a
commit e9ea67bd38
3 changed files with 6 additions and 5 deletions

View File

@@ -162,10 +162,10 @@ export function shallowEqual(objA: any, objB: any) {
}
// Test for A's keys different from B.
for (let i = 0; i < keysA.length; i++) {
for (const key of keysA) {
if (
!Object.prototype.hasOwnProperty.call(objB, keysA[i]) ||
!Object.is(objA[keysA[i]], objB[keysA[i]])
!Object.prototype.hasOwnProperty.call(objB, key) ||
!Object.is(objA[key], objB[key])
) {
return false;
}