UNPKG

return-style

Version:

Non-intrusively convert the result of any function or promise to the user's desired style.

4 lines (3 loc) 206 B
import { Result } from "../classes/result.js"; import { Awaitable } from '@blackglory/prelude'; export declare function toResultAsync<E = Error, T = unknown>(fn: () => Awaitable<T>): Promise<Result<T, E>>;