Skip to main content

liftOption()

liftOption<A, B, E>(f, onNone): (...a) => Either<E, B>

Lifts a function that returns an Option 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) => objectโ€‹

The function to lift.

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

Function to create error for None.


Returnsโ€‹

A lifted function that returns an Either.


Sinceโ€‹

2.0.0