UNPKG

ts-data-forge

Version:

[![npm version](https://img.shields.io/npm/v/ts-data-forge.svg)](https://www.npmjs.com/package/ts-data-forge) [![npm downloads](https://img.shields.io/npm/dm/ts-data-forge.svg)](https://www.npmjs.com/package/ts-data-forge) [![License](https://img.shields.

19 lines 635 B
import { type UnwrapErr, type UnwrapOk, type UnwrapWarn } from './types.mjs'; /** * Returns the Err value or throws if the result is not Err. * * @example * * ```ts * const errValue = TernaryResult.err('boom'); * * assert.strictEqual(TernaryResult.unwrapErrThrow(errValue), 'boom'); * * assert.throws( * () => TernaryResult.unwrapErrThrow(TernaryResult.ok('value')), * /Expected Err/u, * ); * ``` */ export declare const unwrapErrThrow: <R extends UnknownTernaryResult>(result: R, toStr?: (value: UnwrapOk<R> | UnwrapWarn<R>) => string) => UnwrapErr<R>; //# sourceMappingURL=ternary-result-unwrap-err-throw.d.mts.map