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

unwrapOrForResult

Unwraps a result input, returns the content of an Ok(T). If the value is an Err(E) then return defaultValue.

function unwrapOrForResult<T>(input: Result<T, unknown>, defaultValue: T): T;
§
unwrapOrForResult<T>(input: Result<T, unknown>, defaultValue: T): T
[src]

§Type Parameters

§Parameters

§
input: Result<T, unknown>
[src]
§
defaultValue: T
[src]

§Return Type