Skip to content

Commit 4b567cb

Browse files
committed
fix: use in operator only after Object.hasOwn check
1 parent 3f536ad commit 4b567cb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Common/RJSF/utils.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,18 @@ export const parseSchemaHiddenType = (hiddenSchema: HiddenType): MetaHiddenType
173173
if (typeof clone !== 'object') {
174174
return structuredClone(emptyMetaHiddenTypeInstance)
175175
}
176-
if ('condition' in clone && 'value' in clone) {
176+
if (
177+
Object.hasOwn(clone, 'condition') &&
178+
'condition' in clone &&
179+
Object.hasOwn(clone, 'value') &&
180+
'value' in clone
181+
) {
177182
return {
178183
value: clone.condition,
179184
path: conformPathToPointers(clone.value),
180185
}
181186
}
182-
if ('value' in clone && 'path' in clone) {
187+
if (Object.hasOwn(clone, 'value') && 'value' in clone && Object.hasOwn(clone, 'path') && 'path' in clone) {
183188
return {
184189
value: clone.value,
185190
path: conformPathToPointers(clone.path),

0 commit comments

Comments
 (0)