Skip to content

composeCodecs

composeCodecs<A, B>(first, second, name?): Codec<A>

Defined in: src/persistence/migration/Codec.ts:119

Compose two codecs serially: the first transforms domain → mid, the second transforms mid → wire. Decoding runs in reverse. Handy when you want validation on top of a structural transform (e.g. composeCodecs(camelCaseCodec, zodCodec(schema))).

A

B

Codec<A>

Codec<B>

string

Codec<A>