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
Parameter | Type | Description |
---|---|---|
fallback ? | D | fallback 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 Parameter | Default type |
---|---|
T | - |
S extends TSchema | TAny |