MCPcopy Create free account
hub / github.com/effect-app/libs / buildFieldInfoFromFieldsRoot

Function buildFieldInfoFromFieldsRoot

packages/vue/src/form.ts:220–238  ·  view source on GitHub ↗
(
  schema: (S.Codec<To, From, R>) & { fields?: S.Struct.Fields }
)

Source from the content-addressed store, hash-verified

218
219/** @deprecated Use OmegaForm instead */
220export 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
240export interface FieldMetadata {
241 minLength: number | undefined

Callers 4

form.test.tsFile · 0.85
handlePropertySignatureFunction · 0.85
buildFieldInfoFromFieldsFunction · 0.85

Calls 2

getObjectsASTFunction · 0.85
handlePropertySignatureFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…