refactor: use structured clone for local copies

This commit is contained in:
Peter Steinberger
2026-04-20 16:26:24 +01:00
parent 9fa204003f
commit 911cfe2adc
8 changed files with 9 additions and 19 deletions

View File

@@ -1,8 +1,5 @@
export function cloneConfigObject<T>(value: T): T {
if (typeof structuredClone === "function") {
return structuredClone(value);
}
return JSON.parse(JSON.stringify(value)) as T;
return structuredClone(value);
}
export function serializeConfigForm(form: Record<string, unknown>): string {