const AsyncFunction = Object . getPrototypeOf ( async ( ) => { } ) . constructor ; type AsyncFunctionArguments = { [ key ] : any ; } ; export async function callAsyncFunction ( args , source ) { const fn = new AsyncFunction ( ... Object . keys ( args ) , source ) ; return fn ( ... Object . values ( args ) ) ; }