- groupByProp<K, V>(values: Iterable<V>, keySelector: ((item: V) => K), propSet: Iterable<K>): Record<K, V[]>
-
Type Parameters
Type Parameters
-
K extends string | number | symbol
-
V
Parameters
-
values: Iterable<V>
-
keySelector: ((item: V) => K)
-
propSet: Iterable<K>
Returns Record<K, V[]>
- groupByProp<K, V>(values: Iterable<V>, keySelector: ((item: V) => K)): Partial<Record<K, V[]>>
-
Type Parameters
Type Parameters
-
K extends string | number | symbol
-
V
Parameters
-
values: Iterable<V>
-
keySelector: ((item: V) => K)
Returns Partial<Record<K, V[]>>
Example