/** * A function to group array rows by property value (or result of a function) * * Returns a `Map` whose keys are the property value (or the return from the * extractor function) and values are each an array of entries that produced * that value. For example: * * Example: * const books = [{ ... details ..., genre: 'mystery' }, { ... more books ... }] * * // extract the genre by providing a function that returns the genre * const booksByGenre = mapgroupby(books, book => book.genre) * * // extract the genre by providing the property name as a string * // this can also be a dot-separated path to a nested property * const alsoBooksByGenre = mapgroupby(books, 'genre') * * console.log(booksByGenre) * // Map(2) { mystery => [ ... mystery books ... ], adventure => [ ... adventure books ... ] } */ export declare function mapgroupby(objArray: ObjectType[] | undefined, key: Key): Map, ObjectType[]>; export declare function mapgroupby(objArray: ObjectType[] | undefined, key: string): Map, ObjectType[]>; export declare function mapgroupby(objArray: ObjectType[] | undefined, extractor: (obj: ObjectType) => KeyType): Map, ObjectType[]>;