10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0421925 commit 002432bCopy full SHA for 002432b
src/async-function.ts
@@ -1,12 +1,10 @@
1
-type AsyncFunction<A, R> = (args: A) => Promise<R>
2
-
3
export async function callAsyncFunction<A = {}, R = unknown>(
4
args: A,
5
source: string
6
): Promise<R> {
7
const argsKeys = Object.keys(args).join(',')
8
9
- const wrappedFunction: AsyncFunction<A, R> = eval(`async({${argsKeys}}) => {
+ const wrappedFunction: (args: A) => Promise<R> = eval(`async({${argsKeys}}) => {
10
${source}
11
}`)
12
0 commit comments