mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-13 18:14:48 -05:00
12 lines
435 B
TypeScript
12 lines
435 B
TypeScript
interface ObjectConstructor {
|
|
/**
|
|
* Groups members of an iterable according to the return value of the passed callback.
|
|
* @param items An iterable.
|
|
* @param keySelector A callback which will be invoked for each item in items.
|
|
*/
|
|
groupBy<K extends PropertyKey, T>(
|
|
items: Iterable<T>,
|
|
/** @immediate */ keySelector: (item: T, index: number) => K,
|
|
): Partial<Record<K, T[]>>;
|
|
}
|