Aller au contenu principal

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