Skip to content

Commit d207bdb

Browse files
committed
For some reason structureClone does not work but JSON.stringify+parse works.
Fixes #118
1 parent 7c55971 commit d207bdb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/form/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function overwriteDefaultsInJsonSchema<C>(
4040
schema: JSONSchemaType<C>,
4141
defaults: C,
4242
): JSONSchemaType<C> {
43-
const newSchema = structuredClone(schema);
43+
const newSchema = JSON.parse(JSON.stringify(schema)) as JSONSchemaType<C>;
4444
// TODO make more generic, now only handles .properties and .allOf[n].then.properties
4545
for (const key in defaults) {
4646
const val = defaults[key];

0 commit comments

Comments
 (0)