Add missing index parameter to the Array.fromAsync's mapFn (#59837)

This commit is contained in:
Mateusz Burzyński
2024-09-03 19:18:18 +02:00
committed by GitHub
parent a709f9899c
commit fe2cb8ebaa
5 changed files with 103 additions and 53 deletions

View File

@@ -13,5 +13,5 @@ interface ArrayConstructor {
* Each return value is awaited before being added to result array.
* @param thisArg Value of 'this' used when executing mapfn.
*/
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>) => U, thisArg?: any): Promise<Awaited<U>[]>;
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
}