Error: iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.
I have this code snippet but I can't remove this lint error
for (const key of keys1) {
const val1 = object1[key];
const val2 = object2[key];
const areObjects = isObject(val1) && isObject(val2);
const areArrays = Array.isArray(val1) && Array.isArray(val2);
if (
(areArrays && !compareArrays(val1, val2)) ||
(areObjects && !deepEqual(val1, val2)) ||
(!areObjects && val1 !== val2)
) {
return false;
}
}
return true;