MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / deepEqual

Function deepEqual

packages/core/fumadb/src/utils/deep-equal.ts:2–28  ·  view source on GitHub ↗
(a: any, b: any)

Source from the content-addressed store, hash-verified

1// Minimal deep equal utility for primitives, arrays, and plain objects
2export function deepEqual(a: any, b: any): boolean {
3 if (a === b) return true;
4 if (typeof a !== typeof b) return false;
5
6 if (Array.isArray(a) && Array.isArray(b)) {
7 if (a.length !== b.length) return false;
8 for (let i = 0; i < a.length; i++) {
9 if (!deepEqual(a[i], b[i])) return false;
10 }
11 return true;
12 }
13
14 if (typeof a === "object" && typeof b === "object") {
15 const aKeys = Object.keys(a);
16 const bKeys = Object.keys(b);
17 if (aKeys.length !== bKeys.length) return false;
18 for (const key of aKeys) {
19 if (!(key in b)) return false;
20
21 if (!Object.hasOwn(b, key) || !deepEqual(a[key], b[key])) return false;
22 }
23
24 return true;
25 }
26
27 return false;
28}

Callers 6

getSchemasOfVariantFunction · 0.90
migrateToFunction · 0.90
onUniqueConstraintCheckFunction · 0.90
onTableColumnsCheckFunction · 0.90
onTableForeignKeyCheckFunction · 0.90
isCompositeColumnsUniqueFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected