null.
Signature
Type Inference
nullable() creates a union type that includes null:
Basic Usage
With Default Value
If a default value is explicitly provided, return that instead in thenull case:
Lazy Default Values
Default values can be functions that are evaluated lazily:Union Behavior
nullable() is implemented using either(null_, decoder), creating a true union type:
Nullable vs Optional
nullable(): acceptsnullbut rejectsundefinedoptional(): acceptsundefinedbut rejectsnullnullish(): accepts bothnullandundefined
