Skip to content

object

object<T>(properties): ObjectSpec<{ [K in string | number | symbol]: T[K] extends FluentSpec<S> ? S : T[K] & Spec }> & object

Defined in: extract/spec.ts:622

Create an ObjectSpec from a record of specs. Unlike extract(), this does not provide a SpecBuilder for navigation — use it when composing already-constructed specs (e.g., inside forEach bodies).

T extends Record<string, SpecLike>

T

ObjectSpec<{ [K in string | number | symbol]: T[K] extends FluentSpec<S> ? S : T[K] & Spec }> & object

object({
name: variableRef('name', { extract: 'string' }),
items: tryExtract(someArraySpec, literal([])),
})