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

mapOrAsyncForResult

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 mapAsync() and unwrapOr().

function mapOrAsyncForResult<T, E, U>(
input: Result<T, E>,
defaultValue: U,
transformer: AsyncTransformFn<T, U>,
): Promise<U>;
§
mapOrAsyncForResult<T, E, U>(input: Result<T, E>, defaultValue: U, transformer: AsyncTransformFn<T, U>): Promise<U>
[src]

§Type Parameters

§Parameters

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

§Return Type

§
Promise<U>
[src]