Type aliases
OptionOrNullable
OptionOrNullable<
T
> =Option
<T
> |T
|null
A flexible type that allows working with Option values or nullable values.
It defines a looser type that can be used when encoding Options.
This allows us to pass null
or the nested value directly whilst still
supporting the Option type for use-cases that need more type safety.
Type Parameters
Type Parameter | Description |
---|---|
T | The type of the contained value. |
Example
Accepting both Option<T>
and T | null
as input.