( schema: any, defaultValue?: any, allowNull?: boolean, )
| 101 | }; |
| 102 | |
| 103 | const unwrapSchemaWithDefaults = ( |
| 104 | schema: any, |
| 105 | defaultValue?: any, |
| 106 | allowNull?: boolean, |
| 107 | ): [any, any, boolean] => { |
| 108 | if (isArray(schema) && size(schema) === 3 && schema[1] === '=') { |
| 109 | const schemaValue = (schema[0] as any)?.json ?? schema[0]; |
| 110 | return unwrapSchema(schemaValue, schema[2], allowNull); |
| 111 | } |
| 112 | |
| 113 | if (schema?.[_VALUE] && !isUndefined(schema?.[DEFAULT])) { |
| 114 | return unwrapSchema(schema[_VALUE], schema[DEFAULT], allowNull); |
| 115 | } |
| 116 | |
| 117 | return unwrapSchema(schema, defaultValue, allowNull); |
| 118 | }; |
| 119 | |
| 120 | export const createArkTypeSchematizer: typeof createArkTypeSchematizerDecl = |
| 121 | () => createCustomSchematizer(unwrapSchemaWithDefaults, getProperties); |
nothing calls this directly
no test coverage detected
searching dependent graphs…