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 667 B
import { type UnwrapErr, type UnwrapOk, type UnwrapWarn } from './types.mjs'; /** * Returns the Warn value or throws if the result is not Warn. * * @example * * ```ts * const warnValue = TernaryResult.warn('pending', 'check logs'); * * assert.strictEqual(TernaryResult.unwrapWarnThrow(warnValue), 'check logs'); * * assert.throws( * () => TernaryResult.unwrapWarnThrow(TernaryResult.err('err')), * /Expected Warn/u, * ); * ``` */ export declare const unwrapWarnThrow: <R extends UnknownTernaryResult>(result: R, toStr?: (value: UnwrapOk<R> | UnwrapErr<R>) => string) => UnwrapWarn<R>; //# sourceMappingURL=ternary-result-unwrap-warn-throw.d.mts.map