mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
9 lines
195 B
TypeScript
9 lines
195 B
TypeScript
import { groupBy } from 'lodash';
|
|
|
|
export const transformToMapBy = <T>(
|
|
collection: T[],
|
|
key: keyof T,
|
|
): Map<string, T[]> => {
|
|
return new Map(Object.entries(groupBy(collection, key)));
|
|
};
|