mapLefts
Callable
Type parameters
- Xs: Either<unknown, unknown>[]
- T
The mapped type.
Parameters
xs: readonly [Xs]
The either values to map.
f: (ls: ArgLefts<Xs>) => T
The map function.
Returns ArgLefts<Xs> extends never[] ? Right<ArgRights<Xs>[number]> : ArgRights<Xs>[number] extends never[] ? Left<T> : Left<T> | Right<ArgRights<Xs>[number]>
The mapped either object.
mapLefts
takes a tuple ofEither
s and a function that takes the left values of theEither
s and returns a newEither
with the left value being the result of the function and the right value being the right value of the firstEither
in the tuple.Example