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

mapOrElseForOption

Maps a Option<T> to U by applying transformer to a contained Some(T) value in input, or a recoverer function to a contained None value in input. This function can be used to unpack a successful result while handling an error.

function mapOrElseForOption<T, U>(
input: Option<T>,
recoverer: RecoveryFn<U>,
transformer: TransformFn<T, U>,
): U;
§
mapOrElseForOption<T, U>(input: Option<T>, recoverer: RecoveryFn<U>, transformer: TransformFn<T, U>): U
[src]

§Type Parameters

§Parameters

§
input: Option<T>
[src]
§
recoverer: RecoveryFn<U>
[src]
§
transformer: TransformFn<T, U>
[src]

§Return Type