Represents an object that maps properties of a TypeScript type T to
decoders used to validate raw JSON values. Each property may either be a
Decoder<T[P]> (decoding a field from the same key in the input JSON) or
an object with fromKey and decoder to decode from a different input
key.
For the strict variant, the decoder will fail if any keys in the incoming
JSON are not present among the resulting set of JSON keys derived from
the provided decoders. When a decoder uses fromKey, the allowed JSON key
is fromKey rather than the TypeScript property name.
Type Parameters
T
Example
interfaceUser { firstName: string; lastName: string; age: number }
Represents an object that maps properties of a TypeScript type
Tto decoders used to validate raw JSON values. Each property may either be aDecoder<T[P]>(decoding a field from the same key in the input JSON) or an object withfromKeyanddecoderto decode from a different input key.For the strict variant, the decoder will fail if any keys in the incoming JSON are not present among the resulting set of JSON keys derived from the provided decoders. When a decoder uses
fromKey, the allowed JSON key isfromKeyrather than the TypeScript property name.