/
githubmirror
/
TypeScript
Обзор
Документация
Войти
/
githubmirror
/
TypeScript
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/lib/esnext.array.d.ts
17 строк
955 B
Mateusz Burzyński
Add missing `index` parameter to the `Array.fromAsync`'s `mapFn` (#59837)
03 сен 2024, 20:18
Не верифицирован
03 сен 2024, 20:18
fe2cb8e
Код
Авторство
О чём код?
interface ArrayConstructor { /** * Creates an array from an async iterator or iterable object. * @param iterableOrArrayLike An async iterator or array-like object to convert to an array. */ fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>; /** * Creates an array from an async iterator or iterable object. * * @param iterableOrArrayLike An async iterator or array-like object to convert to an array. * @param mapfn A mapping function to call on every element of itarableOrArrayLike. * 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>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>; }