mapOrElseForUndefinable
Return the result of transformer with using input as an argument for it if input is not undefined
.
Otherwise, return the result of recoverer.
Basically, this operation is a combination map()
and unwrapOrElse()
.
U
must not beUndefinable<*>
.- If the result of transformer is
undefined
, this throw anError
. - If the result of recoverer is undefined
, this throw an
Error`.
- If the result of transformer is
- If you'd like to accept
Undefinable<*>
asU
, use a combinationandThen()
andorElse()
.
function mapOrElseForUndefinable<T, U>(
input: Undefinable<T>,
recoverer: RecoveryFn<NotUndefined<U>>,
transformer: TransformFn<T, NotUndefined<U>>,
): NotUndefined<U>;§
mapOrElseForUndefinable<T, U>(input: Undefinable<T>, recoverer: RecoveryFn<NotUndefined<U>>, transformer: TransformFn<T, NotUndefined<U>>): NotUndefined<U>
[src]§Parameters
§
input: Undefinable<T>
[src]§
recoverer: RecoveryFn<NotUndefined<U>>
[src]§
transformer: TransformFn<T, NotUndefined<U>>
[src]