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

This commit is contained in:
LongYinan committed 2023-11-29 15:18:52 +08:00
1 parent acf2de813a
commit e9ea67bd38
3 files changed
+6 -5

No files matched your search

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