struct
Call Signature
Section titled “Call Signature”struct<
Fns>(fields): (value) =>StructOutput<Fns>
Defined in: Composition/struct.ts:23
Builds an object by applying a record of field-level transformer functions to the input value.
The input type is inferred from the transformer parameters, so standalone struct({...}) works.
Own string and symbol keys are processed; inherited fields are ignored.
Type Parameters
Section titled “Type Parameters”Fns extends Record<PropertyKey, (value) => unknown>
Parameters
Section titled “Parameters”fields
Section titled “fields”Fns
Returns
Section titled “Returns”(value) => StructOutput<Fns>
Example
Section titled “Example”Call Signature
Section titled “Call Signature”struct<
A,R>(fields): (value) =>R
Defined in: Composition/struct.ts:26
Builds an object by applying a record of field-level transformer functions to the input value.
The input type is inferred from the transformer parameters, so standalone struct({...}) works.
Own string and symbol keys are processed; inherited fields are ignored.
Type Parameters
Section titled “Type Parameters”A
R extends object
Parameters
Section titled “Parameters”fields
Section titled “fields”{ [K in string | number | symbol]: (value: A) => R[K] }
Returns
Section titled “Returns”(value) => R