Skip to content

Commit 56c1035

Browse files
committed
fix: review comments
1 parent 318a609 commit 56c1035

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/Common/RJSF/utils.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,21 @@ export const parseSchemaHiddenType = (hiddenSchema: HiddenType): MetaHiddenType
155155
if (!hiddenSchema) {
156156
return null
157157
}
158-
if (typeof hiddenSchema === 'string') {
158+
const clone = structuredClone(hiddenSchema)
159+
if (typeof clone === 'string') {
159160
return {
160161
value: false,
161-
path: conformPathToPointers(hiddenSchema),
162+
path: conformPathToPointers(clone),
162163
}
163164
}
164-
if ('condition' in hiddenSchema) {
165+
if ('condition' in clone) {
165166
return {
166-
value: hiddenSchema.condition,
167-
path: conformPathToPointers(hiddenSchema.value),
167+
value: clone.condition,
168+
path: conformPathToPointers(clone.value),
168169
}
169170
}
170171
return {
171-
...hiddenSchema,
172-
path: conformPathToPointers(hiddenSchema.path),
172+
...clone,
173+
path: conformPathToPointers(clone.path),
173174
}
174175
}

0 commit comments

Comments
 (0)