69
70
if (a && typeof a === 'object' && b && typeof b === 'object') {
71
>
if (Object.getPrototypeOf(a) === Object.prototype && Object.getPrototypeOf(b) === Object.prototype) {
equals.ts
72
>
const aObj = a as Record<string, unknown>;
73
>
const bObj = b as Record<string, unknown>;
74
>
const keysA = Object.keys(aObj);
75
>
const keysB = Object.keys(bObj);
76
>
const keysBSet = new Set(keysB);
77
>
78
>
if (keysA.length !== keysB.length) {
79
return false;
80
}
82
>
for (const key of keysA) {
83
>
if (!keysBSet.has(key)) {
84
return false;
85
}
86
>
if (!structuralEquals(aObj[key], bObj[key])) {
equals.ts
87
return false;
88
}
90
>
91
>
return true;
92
>
}
93
>
}
94
95
return false;