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