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