ts-data-forge
Version:
[](https://www.npmjs.com/package/ts-data-forge) [](https://www.npmjs.com/package/ts-data-forge) [ => 1 + 1);
*
* const failure = Result.fromThrowable(() => {
* throw new Error('boom');
* });
*
* assert.deepStrictEqual(success, Result.ok(2));
*
* assert.isTrue(Result.isErr(failure));
* ```
*
* @template T The return type of the function.
* @param fn The function to execute that may throw.
* @returns A `Result<T, Error>` containing either the successful result or
* the caught error.
*/
export declare const fromThrowable: <T>(fn: () => T) => Result<T, Error>;
//# sourceMappingURL=result-from-throwable.d.mts.map