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

okOrForPlainOption

Transforms the Option<T> into a Result<T, E>, mapping Some(v) to Ok(v) and None to Err(err).

Arguments passed to this are eagerly evaluated; if you are passing the result of a function call, it is recommended to use okOrElse, which is lazily evaluated.

function okOrForPlainOption<T, E>(input: Option<T>, err: E): Result<T, E>;
§
okOrForPlainOption<T, E>(input: Option<T>, err: E): Result<T, E>
[src]

§Type Parameters

§Parameters

§
input: Option<T>
[src]
§
err: E
[src]

§Return Type

§
Result<T, E>
[src]