mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
8
packages/server/src/utils/transform-to-map-by.ts
Normal file
8
packages/server/src/utils/transform-to-map-by.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { groupBy } from 'lodash';
|
||||
|
||||
export const transformToMapBy = <T>(
|
||||
collection: T[],
|
||||
key: keyof T,
|
||||
): Map<string, T[]> => {
|
||||
return new Map(Object.entries(groupBy(collection, key)));
|
||||
};
|
||||
Reference in New Issue
Block a user