mapOrAsyncForOption
Return the result of transformer with using input as an argument for it if input is Some(T)
.
Otherwise, return defaultValue.
Basically, this operation is a combination map()
and unwrapOr()
.
function mapOrAsyncForOption<T, U>(
input: Option<T>,
defaultValue: U,
transformer: AsyncTransformFn<T, U>,
): Promise<U>;