@remotion/studio
Version:
APIs for interacting with the Remotion Studio
30 lines (29 loc) • 777 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.deepEqual = deepEqual;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function deepEqual(a, b) {
if (a === b) {
return true;
}
if (a instanceof Date && b instanceof Date) {
return a.getTime() === b.getTime();
}
if (typeof a !== 'object' ||
a === null ||
typeof b !== 'object' ||
b === null) {
return false;
}
const keysA = Object.keys(a);
const keysB = Object.keys(b);
if (keysA.length !== keysB.length) {
return false;
}
for (const key of keysA) {
if (!keysB.includes(key) || !deepEqual(a[key], b[key])) {
return false;
}
}
return true;
}