(schema: any)
| 78 | }; |
| 79 | |
| 80 | const getProperties = (schema: any) => { |
| 81 | const properties: {[key: string]: any} = objNew(); |
| 82 | const schemaData = schema?.json ?? schema; |
| 83 | |
| 84 | if (schemaData?.[REQUIRED]) { |
| 85 | arrayForEach(schemaData[REQUIRED], (field: any) => { |
| 86 | properties[field[KEY]] = field[_VALUE]; |
| 87 | }); |
| 88 | } |
| 89 | |
| 90 | if (schemaData?.[OPTIONAL]) { |
| 91 | arrayForEach(schemaData[OPTIONAL], (field: any) => { |
| 92 | const value = field[_VALUE]; |
| 93 | const defaultVal = field[DEFAULT]; |
| 94 | properties[field[KEY]] = !isUndefined(defaultVal) |
| 95 | ? {[_VALUE]: value, [DEFAULT]: defaultVal} |
| 96 | : value; |
| 97 | }); |
| 98 | } |
| 99 | |
| 100 | return objIsEmpty(properties) ? undefined : properties; |
| 101 | }; |
| 102 | |
| 103 | const unwrapSchemaWithDefaults = ( |
| 104 | schema: any, |
nothing calls this directly
no test coverage detected
searching dependent graphs…