Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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;
§
mapOrForResult<T, E, U>(input: Result<T, E>, defaultValue: U, transformer: TransformFn<T, U>): U
[src]

§Type Parameters

§Parameters

§
input: Result<T, E>
[src]
§
defaultValue: U
[src]
§
transformer: TransformFn<T, U>
[src]

§Return Type