What is evaluated. In body, yield* result.safeUnwrap() works as
Rust's result? expression.
The first occurence of either an yielded Err or a returned Result.
Evaluates the given generator to a Result returned or an Err yielded from it, whichever comes first.
This function, in combination with Result.safeUnwrap(), is intended to emulate
Rust's ? operator.
See /tests/safeTry.test.ts for examples.
What is evaluated. In body, yield* result.safeUnwrap() and
yield* resultAsync.safeUnwrap() work as Rust's result? expression.
The first occurence of either an yielded Err or a returned Result.
Evaluates the given generator to a Result returned or an Err yielded from it, whichever comes first.
This function, in combination with
Result.safeUnwrap(), is intended to emulate Rust's ? operator. See/tests/safeTry.test.tsfor examples.