Transposes an array of options into an optional array,
analagous to how Promise.all() transposes
an array of promises into promised array.
If every option is some, this method returns option.some(arr)
where arr is an array of the unwrapped Options.
Otherwise, this method returns option.none().
Transposes an array of results into an result with an array,
analagous to how Promise.all() transposes
an array of promises into promised array.
If every result is ok, this method returns result.ok(arr)
where arr is an array of the unwrapped Results.
Otherwise, this method returns result.err(e) where e is
the error value of the first result in the array that was an err.
Transposes an array of options into an optional array,
analagous to how Promise.all() transposes
an array of promises into promised array.
If every option is some, this method returns option.some(arr)
where arr is an array of the unwrapped Options.
Otherwise, this method returns option.none().
param
A tuple or array of options.
fromVoidable
fromVoidable<T>(voidable: T | undefined | null): Option<T>
Accepts one argument t, returning none if the t
is null or undefined , otherwise returning some(t).
Transposes an array of results into an result with an array,
analagous to how Promise.all() transposes
an array of promises into promised array.
If every result is ok, this method returns result.ok(arr)
where arr is an array of the unwrapped Results.
Otherwise, this method returns result.err(e) where e is
the error value of the first result in the array that was an err.
Transposes an array of options into an optional array, analagous to how
Promise.all()
transposes an array of promises into promised array.If every option is
some
, this method returnsoption.some(arr)
wherearr
is an array of the unwrappedOption
s. Otherwise, this method returnsoption.none()
.