Evaluates the given generator to a Result returned or an Err yielded from it, whichever comes first.
This function is intended to emulate Rust's ? operator.
See /tests/safeTry.test.ts
for examples.
What is evaluated. In body, yield* result
works as
Rust's result?
expression.
The first occurrence 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 is intended to emulate Rust's ? operator.
See /tests/safeTry.test.ts
for examples.
The first occurrence 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 is intended to emulate Rust's ? operator.
See /tests/safeTry.test.ts
for examples.
What is evaluated. In body, yield* result
works as
Rust's result?
expression.
The first occurrence 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 is intended to emulate Rust's ? operator. See
/tests/safeTry.test.ts
for examples.