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

okOrForUndefinable

Transforms the Undefinable<T> into a Result<T, E> by mapping T to Ok(T). If input is undefined, then return Err(E) with passed 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 okOrForUndefinable<T, E>(input: Undefinable<T>, err: E): Result<T, E>;
§
okOrForUndefinable<T, E>(input: Undefinable<T>, err: E): Result<T, E>
[src]

§Type Parameters

§Parameters

§
err: E
[src]

§Return Type

§
Result<T, E>
[src]