true-myth
Version:
A library for safe functional programming in JavaScript, with first-class support for TypeScript
23 lines (22 loc) • 689 B
TypeScript
/**
Helpers to make it easier to test `Maybe` and `Result`.
@module
*/
import Maybe from './maybe.js';
import Result from './result.js';
/**
Unwrap the contained {@linkcode Just} value. Throws if `maybe` is {@linkcode
"maybe".Nothing Nothing}.
*/
export declare function unwrap<T extends {}>(maybe: Maybe<T>): T;
/**
Unwrap the contained {@linkcode Ok} value. Throws if `result` is an {@linkcode
Err}.
*/
export declare function unwrap<T, E>(result: Result<T, E>): T;
/**
Unwrap the contained {@linkcode Err} error. Throws if `result` is {@linkcode
Ok}.
*/
export declare function unwrapErr<E>(result: Result<unknown, E>): E;
//# sourceMappingURL=test-support.d.ts.map