UNPKG

return-style

Version:

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

3 lines (2 loc) 214 B
import { Awaitable } from '@blackglory/prelude'; export declare function getResultErrorAsync<E = Error, T = unknown>(fn: () => Awaitable<T>): Promise<[result: T, error: undefined] | [result: undefined, error: E]>;