UNPKG

410 BTypeScriptView Raw
1export declare function toMap<TSource, TKey>(source: AsyncIterable<TSource>, keySelector: (item: TSource) => TKey | Promise<TKey>): Promise<Map<TKey, TSource>>;
2export declare function toMap<TSource, TKey, TElement = TSource>(source: AsyncIterable<TSource>, keySelector: (item: TSource) => TKey | Promise<TKey>, elementSelector?: (item: TSource) => TElement | Promise<TElement>): Promise<Map<TKey, TElement>>;