Skip to content

Commit

Permalink
fix(core): config schema array field parsing (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
kon14 authored Sep 27, 2023
1 parent 8058195 commit 0a06464
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/core/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ export default function parseConfigSchema(schema: Indexable) {
delete schema.doc;
deepdash.eachDeep(schema, (value: any, key: string | number, parentValue: any) => {
if (key === 'format') {
parentValue.type = value.charAt(0).toUpperCase() + value.slice(1);
if (
Object.keys(parentValue).includes('children') &&
Object.keys(parentValue['children']).includes('format')
) {
// handle Arrays
parentValue.type = [parentValue['children'].format];
delete parentValue['children'];
} else {
parentValue.type = value.charAt(0).toUpperCase() + value.slice(1);
}
delete parentValue[key];
}
});
Expand Down

0 comments on commit 0a06464

Please sign in to comment.