nullable
Wraps a null or non-null value in an Either, while keeping the information on whether it is filled or empty.
Interactive example
Syntax
typescript
function nullable<
const GenericInput extends unknown = null
>(
input: GenericInput
): GenericInput extends null
? EitherNullableEmpty
: EitherNullableFilled<GenericInput>;Parameters
input: Can benullor a concrete value.
Return value
EitherNullableFilledif the value exists.EitherNullableEmptyifnull.
