@rjsf/utils
Advanced tools
Comparing version 5.13.2 to 5.13.3
@@ -41,5 +41,21 @@ import get from 'lodash/get'; | ||
if (ITEMS_KEY in schema && Array.isArray(formData)) { | ||
formData.forEach((element, i) => { | ||
pathSchema[i] = toPathSchemaInternal(validator, schema.items, `${name}.${i}`, rootSchema, element, _recurseList); | ||
}); | ||
const { items: schemaItems, additionalItems: schemaAdditionalItems } = schema; | ||
if (Array.isArray(schemaItems)) { | ||
formData.forEach((element, i) => { | ||
if (schemaItems[i]) { | ||
pathSchema[i] = toPathSchemaInternal(validator, schemaItems[i], `${name}.${i}`, rootSchema, element, _recurseList); | ||
} | ||
else if (schemaAdditionalItems) { | ||
pathSchema[i] = toPathSchemaInternal(validator, schemaAdditionalItems, `${name}.${i}`, rootSchema, element, _recurseList); | ||
} | ||
else { | ||
console.warn(`Unable to generate path schema for "${name}.${i}". No schema defined for it`); | ||
} | ||
}); | ||
} | ||
else { | ||
formData.forEach((element, i) => { | ||
pathSchema[i] = toPathSchemaInternal(validator, schemaItems, `${name}.${i}`, rootSchema, element, _recurseList); | ||
}); | ||
} | ||
} | ||
@@ -46,0 +62,0 @@ else if (PROPERTIES_KEY in schema) { |
{ | ||
"name": "@rjsf/utils", | ||
"version": "5.13.2", | ||
"version": "5.13.3", | ||
"main": "dist/index.js", | ||
@@ -89,3 +89,3 @@ "module": "lib/index.js", | ||
"license": "Apache-2.0", | ||
"gitHead": "4cfaa984c3343d9cbaabd147c5c24b2c01e28726" | ||
"gitHead": "e00648782c16d4c8857c113a7f13c1ba3b593982" | ||
} |
@@ -76,12 +76,40 @@ import get from 'lodash/get'; | ||
if (ITEMS_KEY in schema && Array.isArray(formData)) { | ||
formData.forEach((element, i: number) => { | ||
pathSchema[i] = toPathSchemaInternal<T, S, F>( | ||
validator, | ||
schema.items as S, | ||
`${name}.${i}`, | ||
rootSchema, | ||
element, | ||
_recurseList | ||
); | ||
}); | ||
const { items: schemaItems, additionalItems: schemaAdditionalItems } = schema; | ||
if (Array.isArray(schemaItems)) { | ||
formData.forEach((element, i: number) => { | ||
if (schemaItems[i]) { | ||
pathSchema[i] = toPathSchemaInternal<T, S, F>( | ||
validator, | ||
schemaItems[i] as S, | ||
`${name}.${i}`, | ||
rootSchema, | ||
element, | ||
_recurseList | ||
); | ||
} else if (schemaAdditionalItems) { | ||
pathSchema[i] = toPathSchemaInternal<T, S, F>( | ||
validator, | ||
schemaAdditionalItems as S, | ||
`${name}.${i}`, | ||
rootSchema, | ||
element, | ||
_recurseList | ||
); | ||
} else { | ||
console.warn(`Unable to generate path schema for "${name}.${i}". No schema defined for it`); | ||
} | ||
}); | ||
} else { | ||
formData.forEach((element, i: number) => { | ||
pathSchema[i] = toPathSchemaInternal<T, S, F>( | ||
validator, | ||
schemaItems as S, | ||
`${name}.${i}`, | ||
rootSchema, | ||
element, | ||
_recurseList | ||
); | ||
}); | ||
} | ||
} else if (PROPERTIES_KEY in schema) { | ||
@@ -88,0 +116,0 @@ for (const property in schema.properties) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1509097
18955