Introduce a new instance method on Result and ResultAsync
unwrapOrElse<U>(op: (err: E) => U): T | U
- Success (Ok): returns the contained T.
- Failure (Err): calls the provided callback op with the error E and returns the callback’s return value.
This would prevent having to use .match with a callback such as (value) => value, in the first parameter.