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

mapOrAsyncForOption

Return the result of transformer with using input as an argument for it if input is Some(T). Otherwise, return defaultValue.

Basically, this operation is a combination map() and unwrapOr().

function mapOrAsyncForOption<T, U>(
input: Option<T>,
defaultValue: U,
transformer: AsyncTransformFn<T, U>,
): Promise<U>;
§
mapOrAsyncForOption<T, U>(input: Option<T>, defaultValue: U, transformer: AsyncTransformFn<T, U>): Promise<U>
[src]

§Type Parameters

§Parameters

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

§Return Type

§
Promise<U>
[src]