undefined.
Signature
Type Inference
optional() creates a union type that includes undefined:
Basic Usage
With Default Value
If a default value is explicitly provided, return that instead in theundefined case:
Lazy Default Values
Default values can be functions that are evaluated lazily:Union Behavior
optional() is implemented using either(undefined_, decoder), creating a true union type:
