(
schema: (S.Codec<To, From, R>) & { fields?: S.Struct.Fields }
)
| 218 | |
| 219 | /** @deprecated Use OmegaForm instead */ |
| 220 | export function buildFieldInfoFromFieldsRoot< |
| 221 | From extends Record<PropertyKey, any>, |
| 222 | To extends Record<PropertyKey, any>, |
| 223 | R |
| 224 | >( |
| 225 | schema: (S.Codec<To, From, R>) & { fields?: S.Struct.Fields } |
| 226 | ): NestedFieldInfo<To> { |
| 227 | const ast = getObjectsAST(schema.ast) |
| 228 | |
| 229 | if (!ast) throw new Error("not a struct type") |
| 230 | return ast.propertySignatures.reduce( |
| 231 | (acc, cur) => { |
| 232 | ;(acc.fields as any)[cur.name] = handlePropertySignature(cur) |
| 233 | |
| 234 | return acc |
| 235 | }, |
| 236 | { _tag: "NestedFieldInfo", fields: {} } as NestedFieldInfo<To> |
| 237 | ) |
| 238 | } |
| 239 | |
| 240 | export interface FieldMetadata { |
| 241 | minLength: number | undefined |
no test coverage detected
searching dependent graphs…