diff --git a/test/test.ts b/test/test.both.ts similarity index 100% rename from test/test.ts rename to test/test.both.ts diff --git a/ts/index.ts b/ts/index.ts index a40df85..341d1ad 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -84,11 +84,11 @@ export const map = async (inputArg: T[], functionArg: IAsyncFunction) => { return resultArray; }; -export const timeoutWrap = (ms, promise) => { +export const timeoutWrap = (promiseArg: Promise, timeoutInMs: number) => { return new Promise((resolve, reject) => { setTimeout(() => { reject(new Error('timeout')); - }, ms); - promise.then(resolve, reject); + }, timeoutInMs); + promiseArg.then(resolve, reject); }); };