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
orundefined
, throwTypeError
.
function unwrapOrForMaybe<T>(input: Maybe<T>, defaultValue: NotNullOrUndefined<T>): NotNullOrUndefined<T>;