mirror of
https://github.com/actions/github-script.git
synced 2026-02-08 03:57:27 +00:00
Remove unnecessary type
This commit is contained in:
parent
04219251e3
commit
002432b25e
1 changed files with 1 additions and 3 deletions
|
|
@ -1,12 +1,10 @@
|
||||||
type AsyncFunction<A, R> = (args: A) => Promise<R>
|
|
||||||
|
|
||||||
export async function callAsyncFunction<A = {}, R = unknown>(
|
export async function callAsyncFunction<A = {}, R = unknown>(
|
||||||
args: A,
|
args: A,
|
||||||
source: string
|
source: string
|
||||||
): Promise<R> {
|
): Promise<R> {
|
||||||
const argsKeys = Object.keys(args).join(',')
|
const argsKeys = Object.keys(args).join(',')
|
||||||
|
|
||||||
const wrappedFunction: AsyncFunction<A, R> = eval(`async({${argsKeys}}) => {
|
const wrappedFunction: (args: A) => Promise<R> = eval(`async({${argsKeys}}) => {
|
||||||
${source}
|
${source}
|
||||||
}`)
|
}`)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue