UNPKG

true-myth

Version:

A library for safe functional programming in JavaScript, with first-class support for TypeScript

14 lines (13 loc) 586 B
/** Helpers to make it easier to test `Maybe` and `Result`. @module */ import Maybe from './maybe.cjs'; import Result from './result.cjs'; /** Unwrap the contained `Just` value. Throws if `maybe` is `Nothing`. */ export declare function unwrap<T>(maybe: Maybe<T>): T; /** Unwrap the contained `Ok` value. Throws if `result` is `Err`. */ export declare function unwrap<T, E>(result: Result<T, E>): T; /** Unwrap the contained `Err` error. Throws if `result` is `Ok`. */ export declare function unwrapErr<E>(result: Result<unknown, E>): E; //# sourceMappingURL=test-support.d.ts.map