const deepEqual = (a, b) => {
if (a === null || b === null || typeof a !== 'object' || typeof b !== 'object') {
return a === b;
}
const aKeys = Object.keys(a);
const bKeys = Object.keys(b);
if (aKeys.length !== bKeys.length) {
return false;
}
return aKeys.every(
(key) => bKeys.includes(key) && deepEqual(a[key], b[key]),
);
}