Skip to content

InferOfDef

InferOfDef<D> = D extends ResolvedDef<infer T> ? T : D extends string ? type.infer<D> : D extends object ? type.infer<D> : never

Defined in: src/parse/index.ts:117

The TS type of a def (string expression, object def, or resolved carrier). Refinements erase automatically (type.infer<“number > 0”> = number).

Deliberately UNSCOPED: parser-scope aliases never reach this as raw strings — schema leaf defs resolve ONCE at ident/path parse time into a ResolvedDef carrier (ResolveLeafDef below), and constraint/result defs are builder-validated against the default scope. Keeping every def interpretation scope-free means constraint-check instantiations are IDENTICAL for scoped and unscoped parsers (one shared memoization set), which is what keeps deep chains inside the recursion budget across TypeScript versions (5.7 has less headroom than 5.9 — canary-pinned in types.typetest.ts).

D