import { Awaitable } from '@blackglory/prelude' export async function getResultErrorAsync( fn: () => Awaitable ): Promise<[result: T, error: undefined] | [result: undefined, error: E]> { try { const result = await fn() return [result, void 0] } catch (err) { return [void 0, err as E] } }