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