Remove unnecessary type

This commit is contained in:
Jonathan Clem 2020-07-17 11:45:02 -04:00
parent 04219251e3
commit 002432b25e
No known key found for this signature in database
GPG key ID: B3662C4A8F843179

View file

@ -1,12 +1,10 @@
type AsyncFunction<A, R> = (args: A) => Promise<R>
export async function callAsyncFunction<A = {}, R = unknown>(
args: A,
source: string
): Promise<R> {
const argsKeys = Object.keys(args).join(',')
const wrappedFunction: AsyncFunction<A, R> = eval(`async({${argsKeys}}) => {
const wrappedFunction: (args: A) => Promise<R> = eval(`async({${argsKeys}}) => {
${source}
}`)