- groupBy<T, I, K>(iterable, keySelector, itemSelector?): Record<K, I[]>
-
Type Parameters
-
T
-
I = T
-
K extends string | number = string
Parameters
-
iterable: Iterable<T>
-
keySelector: keyof T | ((item) => undefined | K)
-
Optional
itemSelector: ((item) => I)
Returns Record<K, I[]>
- groupBy<T, K, I>(iterable, keySelector, itemSelector?): Promise<Record<K, I[]>>
-
Type Parameters
-
T
-
K extends string | number
-
I = T
Parameters
-
iterable: Iterable<T>
-
keySelector: ((item) => Promise<undefined | K>)
-
- (item): Promise<undefined | K>
-
Returns Promise<undefined | K>
-
Optional
itemSelector: ((item) => I)
Returns Promise<Record<K, I[]>>
Groups an array into key accessible groups of objects