mapOrForResult
Return the result of transformer with using input as an argument for it if input is Ok(T)
.
Otherwise, return defaultValue.
Basically, this operation is a combination map()
and unwrapOr()
.
function mapOrForResult<T, E, U>(
input: Result<T, E>,
defaultValue: U,
transformer: TransformFn<T, U>,
): U;