ts-data-forge
Version:
[](https://www.npmjs.com/package/ts-data-forge) [](https://www.npmjs.com/package/ts-data-forge) [;
*
* const errResult = Result.err(new Error('fail'));
*
* assert.isTrue(Result.unwrapThrow(okResult) === 'data');
*
* assert.throws(() => Result.unwrapThrow(errResult), /fail/u);
* ```
*
* @template R The `UnknownResult` type to unwrap.
* @param result The `Result` to unwrap.
* @param toStr An optional function to convert the error value to a string
* for the error message. Defaults to `String`.
* @returns The success value if `Result.Ok`.
* @throws {Error} Error with the stringified error value if the `Result` is
* `Result.Err`.
*/
export declare const unwrapThrow: <R extends UnknownResult>(result: R, toStr?: (e: UnwrapErr<R>) => string) => UnwrapOk<R>;
//# sourceMappingURL=result-unwrap-throw.d.mts.map