import type { AsyncReturnType, Fn } from "../index.js"; export default async function callSafe( this: any, fn: Func, ...args: any ): Promise<[null | any, AsyncReturnType?]> { try { return [null, await fn.call(this, ...args)]; } catch (error) { return [error]; } }