Applies a transformation function to the error value of a Result or ResultAsync. If the input is a Success, it will be returned unchanged.
The input Result or ResultAsync.
The transformed error value type.
pipe - It is recommended to use this function with the pipe function for better readability and composability.
mapError<
R1
,E2
>(fn
): (result
) =>ResultFor
<R1
,InferSuccess
<R1
>,E2
>
Defined in: functions/map-error.ts:44
R1
extends ResultMaybeAsync
<any
, any
>
E2
(a
) => E2
(
result
):ResultFor
<R1
,InferSuccess
<R1
>,E2
>
R1
ResultFor
<R1
, InferSuccess
<R1
>, E2
>
mapError<
E1
,E2
>(fn
): <R1
>(result
) =>ResultFor
<R1
,InferSuccess
<R1
>,E2
>
Defined in: functions/map-error.ts:45
E1
E2
(a
) => E2
<
R1
>(result
):ResultFor
<R1
,InferSuccess
<R1
>,E2
>
R1
extends ResultMaybeAsync
<any
, E1
>
R1
ResultFor
<R1
, InferSuccess
<R1
>, E2
>