Skip to main content

liftNullable()

liftNullable<A, B, E>(f, onNullable): (...a) => Either<E, NonNullable<B>>

Lifts a function that may return null/undefined to return an Either.


Type Parametersโ€‹

A: A extends readonly unknown[]โ€‹

The argument types.

B: Bโ€‹

The return type.

E: Eโ€‹

The error type.


Parametersโ€‹

f: (...a) => Nullish<B>โ€‹

The function to lift.

onNullable: (...a) => Eโ€‹

Function to create error for null/undefined.


Returnsโ€‹

A lifted function that returns an Either.


Sinceโ€‹

2.0.0