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:
7
packages/server/src/utils/transform-to-map-key-value.ts
Normal file
7
packages/server/src/utils/transform-to-map-key-value.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const transformToMapKeyValue = <T, K extends string | number>(
|
||||
collection: T[],
|
||||
key: keyof T,
|
||||
): Map<K, T> => {
|
||||
// @ts-ignore
|
||||
return new Map(collection.map((item) => [item[key], item]));
|
||||
};
|
||||
Reference in New Issue
Block a user