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 597 B
import { type UnwrapErr } from './types.mjs'; /** * Safely unwraps the Err value. * * @example * * ```ts * const errValue = TernaryResult.err('fail'); * * const okValue = TernaryResult.ok('value'); * * assert.strictEqual(TernaryResult.unwrapErr(errValue), 'fail'); * * // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression * assert.strictEqual(TernaryResult.unwrapErr(okValue), undefined); * ``` */ export declare const unwrapErr: <R extends UnknownTernaryResult>(result: R) => UnwrapErr<R> | undefined; //# sourceMappingURL=ternary-result-unwrap-err.d.mts.map