feat(org-chart): add core cards and fixed-layout integration
This commit is contained in:
1 parent
d18e3c3380
commit
61c6f8d1f1
161 files changed
+13044
-1
No files matched your search
@@ -0,0 +1,14 @@
|
||||
/** Own a JSON-like input at the call boundary; never retain consumer objects. */
|
||||
export function snapshotOrgChartDataset<T>(input: T): T {
|
||||
const copy = structuredClone(input);
|
||||
const pending: unknown[] = [copy];
|
||||
const seen = new WeakSet<object>();
|
||||
while (pending.length) {
|
||||
const current = pending.pop();
|
||||
if (current === null || typeof current !== 'object' || seen.has(current)) continue;
|
||||
seen.add(current);
|
||||
for (const child of Object.values(current)) pending.push(child);
|
||||
Object.freeze(current);
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
Reference in new issue
Block a user