unwrapOrForUndefinable
Return input as T
if the passed input is not undefined
.
Otherwise, return defaultValue.
- defaultValue must not be
Undefinable<*>
. - If the result of defaultValue is
undefined
, throwTypeError
.
function unwrapOrForUndefinable<T>(input: Undefinable<T>, defaultValue: NotUndefined<T>): NotUndefined<T>;