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

unwrapOrForMaybe

Return input as T if the passed input is not null and undefined. Otherwise, return defaultValue.

  • defaultValue must not be Maybe<*>.
  • If the defaultValue is null or undefined, throw TypeError.
function unwrapOrForMaybe<T>(input: Maybe<T>, defaultValue: NotNullOrUndefined<T>): NotNullOrUndefined<T>;
§
unwrapOrForMaybe<T>(input: Maybe<T>, defaultValue: NotNullOrUndefined<T>): NotNullOrUndefined<T>
[src]

§Type Parameters

§Parameters

§
input: Maybe<T>
[src]
§
defaultValue: NotNullOrUndefined<T>
[src]