ts-data-forge
Version:
[](https://www.npmjs.com/package/ts-data-forge) [](https://www.npmjs.com/package/ts-data-forge) [;
*
* const errResult = Result.err('problem');
*
* // Result.unwrapErr returns undefined for Ok results
*
* // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
* assert.isTrue(Result.unwrapErr(okResult) === undefined);
*
* // Result.unwrapErr returns the error value for Err results
*
* assert.isTrue(Result.unwrapErr(errResult) === 'problem');
* ```
*
* @template R The `UnknownResult` type to unwrap.
* @param result The `Result` to unwrap.
* @returns The error value if `Result.Err`, otherwise `undefined`.
*/
export declare const unwrapErr: <R extends UnknownResult>(result: R) => UnwrapErr<R> | undefined;
//# sourceMappingURL=result-unwrap-err.d.mts.map