law-common 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,5 +4,7 @@ export type IClientApiEntity = IApiEntity<IClientEntity>;
|
|
|
4
4
|
export type IClientApiEntityArray = IClientApiEntity[];
|
|
5
5
|
export type IGetClientsByFilter = {
|
|
6
6
|
clients: IClientApiEntityArray;
|
|
7
|
-
users:
|
|
7
|
+
users: {
|
|
8
|
+
[key: string]: IUserApiEntity;
|
|
9
|
+
};
|
|
8
10
|
};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export declare function groupByFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T[]>;
|
|
2
2
|
export declare function groupByOneToOneFunction<T, K>(list: T[], keyGetter: (input: T) => K): Map<K, T>;
|
|
3
|
+
export declare function convertMapToObject<K, T>(map: Map<K, T>): {
|
|
4
|
+
[key: string]: T;
|
|
5
|
+
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.groupByFunction = groupByFunction;
|
|
4
4
|
exports.groupByOneToOneFunction = groupByOneToOneFunction;
|
|
5
|
+
exports.convertMapToObject = convertMapToObject;
|
|
5
6
|
function groupByFunction(list, keyGetter) {
|
|
6
7
|
const map = new Map();
|
|
7
8
|
list.forEach((item) => {
|
|
@@ -24,3 +25,6 @@ function groupByOneToOneFunction(list, keyGetter) {
|
|
|
24
25
|
});
|
|
25
26
|
return map;
|
|
26
27
|
}
|
|
28
|
+
function convertMapToObject(map) {
|
|
29
|
+
return Object.fromEntries(map);
|
|
30
|
+
}
|