Skip to content

Type Alias: TTransformer<T, S>

TTransformer<T, S>: TTransform<TString, T> & object

Transformer type

Type declaration

optional()

optional: <D>(fallback?) => [D] extends [T] ? TTransform<TString, T> : TOptional<TTransform<TString, T | undefined>>

Get optional variant of this transformer

Type Parameters

Type Parameter
D extends T | undefined

Parameters

ParameterTypeDescription
fallback?Dfallback value when the input is empty

Returns

[D] extends [T] ? TTransform<TString, T> : TOptional<TTransform<TString, T | undefined>>

TTransform, with optional kind if no fallback is given

validateSchema

validateSchema: S

A schema for decode's output and encode's input validation

Type Parameters

Type ParameterDefault type
T-
S extends TSchemaTAny

Defined in

src/transformer/create-transformer.ts:18

Released under the MIT License.