@contrail/data-grouping 1.0.24 → 1.0.25
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/lib/data-group-generator/data-group-generator.d.ts +7 -7
- package/lib/data-group-generator/data-group-generator.js +133 -130
- package/lib/data-group-generator/index.d.ts +1 -1
- package/lib/data-group-generator/index.js +17 -17
- package/lib/index.d.ts +2 -2
- package/lib/index.js +18 -19
- package/lib/interfaces.d.ts +31 -31
- package/lib/interfaces.js +2 -2
- package/package.json +44 -44
package/README.md
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
Library for use with @contrail/documents that allows for the quick/automation generation of
|
2
|
-
documents based on templates and layout options.
|
1
|
+
Library for use with @contrail/documents that allows for the quick/automation generation of
|
2
|
+
documents based on templates and layout options.
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { DataGroup, DataGroupStructure, DataGroupingProperty } from
|
2
|
-
export declare class DataGroupGenerator {
|
3
|
-
static getDistinctValues(data: any,
|
4
|
-
static buildChildDataGroups(data: any, parentGroup: DataGroup, groupingProperties: Array<DataGroupingProperty>, leafNodeDataCount: any, currentDepth: any, groupMultiSelectInSeparateFrame?: boolean): void;
|
5
|
-
static buildDataGroupStructure(data: Array<any>, groupingProperties: Array<DataGroupingProperty>, leafNodeDataCount: number, groupMultiSelectInSeparateFrame?: boolean): DataGroupStructure;
|
6
|
-
static createPartitionedGroupsFromData(parentGroup: DataGroup, data: Array<any>, leafNodeDataCount: number): Array<DataGroup>;
|
7
|
-
}
|
1
|
+
import { DataGroup, DataGroupStructure, DataGroupingProperty } from '../interfaces';
|
2
|
+
export declare class DataGroupGenerator {
|
3
|
+
static getDistinctValues(data: any, indexRootSlug: any, indexSlug?: any, altIndexRootSlug?: any, altIndexSlug?: any, groupMultiSelectInSeparateFrame?: boolean): any[];
|
4
|
+
static buildChildDataGroups(data: any, parentGroup: DataGroup, groupingProperties: Array<DataGroupingProperty>, leafNodeDataCount: any, currentDepth: any, groupMultiSelectInSeparateFrame?: boolean): void;
|
5
|
+
static buildDataGroupStructure(data: Array<any>, groupingProperties: Array<DataGroupingProperty>, leafNodeDataCount: number, groupMultiSelectInSeparateFrame?: boolean): DataGroupStructure;
|
6
|
+
static createPartitionedGroupsFromData(parentGroup: DataGroup, data: Array<any>, leafNodeDataCount: number): Array<DataGroup>;
|
7
|
+
}
|
@@ -1,130 +1,133 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DataGroupGenerator = void 0;
|
4
|
-
const util_1 = require("@contrail/util");
|
5
|
-
const types_1 = require("@contrail/types");
|
6
|
-
class DataGroupGenerator {
|
7
|
-
static getDistinctValues(data,
|
8
|
-
const map = new Map();
|
9
|
-
const sortingArray = [];
|
10
|
-
data.forEach(obj => {
|
11
|
-
if (!obj) {
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
let key = util_1.ObjectUtil.
|
15
|
-
let altKey = null;
|
16
|
-
if (
|
17
|
-
altKey = util_1.ObjectUtil.
|
18
|
-
if (!key) {
|
19
|
-
key = altKey;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
let value = key;
|
23
|
-
if (!value) {
|
24
|
-
return;
|
25
|
-
}
|
26
|
-
if (key && value && typeof key === 'object') {
|
27
|
-
key = value.id || value.name || value;
|
28
|
-
}
|
29
|
-
if (Array.isArray(value) && !groupMultiSelectInSeparateFrame) {
|
30
|
-
value.forEach(arrayValue => {
|
31
|
-
map[arrayValue] = arrayValue;
|
32
|
-
if (!sortingArray.includes(arrayValue)) {
|
33
|
-
sortingArray.push(arrayValue);
|
34
|
-
}
|
35
|
-
});
|
36
|
-
}
|
37
|
-
else {
|
38
|
-
map[key] = value;
|
39
|
-
if (!sortingArray.includes(value)) {
|
40
|
-
sortingArray.push(value);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
});
|
44
|
-
const distinctValues = [...
|
45
|
-
let val1 =
|
46
|
-
let val2 =
|
47
|
-
return sortingArray.indexOf(val1) - sortingArray.indexOf(val2);
|
48
|
-
});
|
49
|
-
return distinctValues;
|
50
|
-
}
|
51
|
-
static buildChildDataGroups(data, parentGroup, groupingProperties, leafNodeDataCount, currentDepth, groupMultiSelectInSeparateFrame = false) {
|
52
|
-
const groupingProperty = groupingProperties[currentDepth];
|
53
|
-
const
|
54
|
-
const
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
return objVal.
|
64
|
-
}
|
65
|
-
else if (val
|
66
|
-
return
|
67
|
-
}
|
68
|
-
else {
|
69
|
-
return
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
}
|
81
|
-
if (
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
this.
|
93
|
-
}
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
const
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
}
|
130
|
-
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DataGroupGenerator = void 0;
|
4
|
+
const util_1 = require("@contrail/util");
|
5
|
+
const types_1 = require("@contrail/types");
|
6
|
+
class DataGroupGenerator {
|
7
|
+
static getDistinctValues(data, indexRootSlug, indexSlug = null, altIndexRootSlug = null, altIndexSlug = null, groupMultiSelectInSeparateFrame = false) {
|
8
|
+
const map = new Map();
|
9
|
+
const sortingArray = [];
|
10
|
+
data.forEach(obj => {
|
11
|
+
if (!obj) {
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
let key = util_1.ObjectUtil.getBySlugs(obj, indexRootSlug, indexSlug);
|
15
|
+
let altKey = null;
|
16
|
+
if (altIndexRootSlug) {
|
17
|
+
altKey = util_1.ObjectUtil.getBySlugs(obj, altIndexRootSlug, altIndexSlug);
|
18
|
+
if (!key) {
|
19
|
+
key = altKey;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
let value = key;
|
23
|
+
if (!value) {
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
if (key && value && typeof key === 'object') {
|
27
|
+
key = value.id || value.name || value;
|
28
|
+
}
|
29
|
+
if (Array.isArray(value) && !groupMultiSelectInSeparateFrame) {
|
30
|
+
value.forEach(arrayValue => {
|
31
|
+
map[arrayValue] = arrayValue;
|
32
|
+
if (!sortingArray.includes(arrayValue)) {
|
33
|
+
sortingArray.push(arrayValue);
|
34
|
+
}
|
35
|
+
});
|
36
|
+
}
|
37
|
+
else {
|
38
|
+
map[key] = value;
|
39
|
+
if (!sortingArray.includes(value)) {
|
40
|
+
sortingArray.push(value);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
});
|
44
|
+
const distinctValues = [...Object.values(map)].sort((v1, v2) => {
|
45
|
+
let val1 = v1 && typeof v1 === 'object' ? v1.name : v1;
|
46
|
+
let val2 = v2 && typeof v2 === 'object' ? v2.name : v2;
|
47
|
+
return sortingArray.indexOf(val1) - sortingArray.indexOf(val2);
|
48
|
+
});
|
49
|
+
return distinctValues;
|
50
|
+
}
|
51
|
+
static buildChildDataGroups(data, parentGroup, groupingProperties, leafNodeDataCount, currentDepth, groupMultiSelectInSeparateFrame = false) {
|
52
|
+
const groupingProperty = groupingProperties[currentDepth];
|
53
|
+
const indexRootSlug = groupingProperty.typeRootSlug;
|
54
|
+
const indexSlug = groupingProperty.propertyDefinition.slug;
|
55
|
+
const altIndexRootSlug = util_1.StringUtil.convertToCamelCase(groupingProperty.typeRootSlug);
|
56
|
+
const altIndexSlug = groupingProperty.propertyDefinition.slug;
|
57
|
+
let distinctValues = this.getDistinctValues(data, indexRootSlug, indexSlug, altIndexRootSlug, altIndexSlug, groupMultiSelectInSeparateFrame);
|
58
|
+
for (let val of distinctValues) {
|
59
|
+
const groupData = data.filter(obj => {
|
60
|
+
const objVal = util_1.ObjectUtil.getBySlugs(obj, indexRootSlug, indexSlug) ||
|
61
|
+
util_1.ObjectUtil.getBySlugs(obj, altIndexRootSlug, altIndexSlug);
|
62
|
+
if (Array.isArray(val) && Array.isArray(objVal)) {
|
63
|
+
return val.sort().join() === objVal.sort().join();
|
64
|
+
}
|
65
|
+
else if (!Array.isArray(val) && Array.isArray(objVal)) {
|
66
|
+
return objVal.includes(val);
|
67
|
+
}
|
68
|
+
else if (val.id && (objVal === null || objVal === void 0 ? void 0 : objVal.id)) {
|
69
|
+
return val.id === objVal.id;
|
70
|
+
}
|
71
|
+
else {
|
72
|
+
return objVal === val;
|
73
|
+
}
|
74
|
+
});
|
75
|
+
const group = {
|
76
|
+
data: [],
|
77
|
+
subGroups: [],
|
78
|
+
propertyValues: {},
|
79
|
+
name: '',
|
80
|
+
};
|
81
|
+
if (groupingProperty.isSecondaryGroup) {
|
82
|
+
group.isSecondaryGroup = true;
|
83
|
+
}
|
84
|
+
if (groupData.length > 0) {
|
85
|
+
const details = groupData[0];
|
86
|
+
group.propertyValues = Object.assign({}, details);
|
87
|
+
}
|
88
|
+
group.propertyValues[groupingProperty.propertyDefinition.slug] = val;
|
89
|
+
const label = new types_1.PropertyValueFormatter().formatValueForProperty(val, groupingProperty.propertyDefinition);
|
90
|
+
group.name = label;
|
91
|
+
if (currentDepth === groupingProperties.length - 1) {
|
92
|
+
group.subGroups = this.createPartitionedGroupsFromData(group, groupData, leafNodeDataCount);
|
93
|
+
}
|
94
|
+
else if (currentDepth < groupingProperties.length - 1) {
|
95
|
+
this.buildChildDataGroups(groupData, group, groupingProperties, leafNodeDataCount, currentDepth + 1, groupMultiSelectInSeparateFrame);
|
96
|
+
}
|
97
|
+
parentGroup.subGroups.push(group);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
static buildDataGroupStructure(data, groupingProperties, leafNodeDataCount, groupMultiSelectInSeparateFrame = false) {
|
101
|
+
const structure = {
|
102
|
+
rootGroup: {
|
103
|
+
subGroups: [],
|
104
|
+
name: 'root',
|
105
|
+
propertyValues: {},
|
106
|
+
data: [],
|
107
|
+
},
|
108
|
+
groupingProperties,
|
109
|
+
depth: groupingProperties ? groupingProperties.length : 0,
|
110
|
+
};
|
111
|
+
this.buildChildDataGroups(data, structure.rootGroup, groupingProperties, leafNodeDataCount, 0, groupMultiSelectInSeparateFrame);
|
112
|
+
return structure;
|
113
|
+
}
|
114
|
+
static createPartitionedGroupsFromData(parentGroup, data, leafNodeDataCount) {
|
115
|
+
const dataLength = data.length;
|
116
|
+
const frameCount = Math.ceil(dataLength / leafNodeDataCount);
|
117
|
+
const groups = [];
|
118
|
+
for (let i = 1; i <= frameCount; i++) {
|
119
|
+
const startIndex = (i - 1) * leafNodeDataCount;
|
120
|
+
const endIndex = startIndex + leafNodeDataCount;
|
121
|
+
let groupData = data.slice(startIndex, endIndex);
|
122
|
+
const group = {
|
123
|
+
data: groupData,
|
124
|
+
subGroups: [],
|
125
|
+
name: parentGroup.name,
|
126
|
+
propertyValues: parentGroup.propertyValues,
|
127
|
+
};
|
128
|
+
groups.push(group);
|
129
|
+
}
|
130
|
+
return groups;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
exports.DataGroupGenerator = DataGroupGenerator;
|
@@ -1 +1 @@
|
|
1
|
-
export * from './data-group-generator';
|
1
|
+
export * from './data-group-generator';
|
@@ -1,17 +1,17 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./data-group-generator"), exports);
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./data-group-generator"), exports);
|
package/lib/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './interfaces';
|
2
|
-
export * from './data-group-generator';
|
1
|
+
export * from './interfaces';
|
2
|
+
export * from './data-group-generator';
|
package/lib/index.js
CHANGED
@@ -1,19 +1,18 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
-
};
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./interfaces"), exports);
|
18
|
-
;
|
19
|
-
__exportStar(require("./data-group-generator"), exports);
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./interfaces"), exports);
|
18
|
+
__exportStar(require("./data-group-generator"), exports);
|
package/lib/interfaces.d.ts
CHANGED
@@ -1,31 +1,31 @@
|
|
1
|
-
import { TypeProperty } from
|
2
|
-
export interface DataGroup {
|
3
|
-
subGroups: Array<DataGroup>;
|
4
|
-
name: string;
|
5
|
-
propertyValues: {
|
6
|
-
[key: string]: any;
|
7
|
-
};
|
8
|
-
aggregateValues?: {
|
9
|
-
[key: string]: any;
|
10
|
-
};
|
11
|
-
data: Array<any>;
|
12
|
-
isSecondaryGroup?: boolean;
|
13
|
-
}
|
14
|
-
export interface DataGroupStructure {
|
15
|
-
rootGroup: DataGroup;
|
16
|
-
depth: number;
|
17
|
-
groupingProperties: Array<DataGroupingProperty>;
|
18
|
-
aggregationProperties?: Array<DataGroupingProperty>;
|
19
|
-
sourceDataDefinition?: {
|
20
|
-
sourceDataReference: string;
|
21
|
-
filterDefinition?: any;
|
22
|
-
sortDefinition?: any;
|
23
|
-
};
|
24
|
-
}
|
25
|
-
export interface DataGroupingProperty {
|
26
|
-
propertyDefinition: TypeProperty;
|
27
|
-
values?: Array<string>;
|
28
|
-
typeRootSlug: string;
|
29
|
-
sort: string;
|
30
|
-
isSecondaryGroup?: boolean;
|
31
|
-
}
|
1
|
+
import { TypeProperty } from '@contrail/types';
|
2
|
+
export interface DataGroup {
|
3
|
+
subGroups: Array<DataGroup>;
|
4
|
+
name: string;
|
5
|
+
propertyValues: {
|
6
|
+
[key: string]: any;
|
7
|
+
};
|
8
|
+
aggregateValues?: {
|
9
|
+
[key: string]: any;
|
10
|
+
};
|
11
|
+
data: Array<any>;
|
12
|
+
isSecondaryGroup?: boolean;
|
13
|
+
}
|
14
|
+
export interface DataGroupStructure {
|
15
|
+
rootGroup: DataGroup;
|
16
|
+
depth: number;
|
17
|
+
groupingProperties: Array<DataGroupingProperty>;
|
18
|
+
aggregationProperties?: Array<DataGroupingProperty>;
|
19
|
+
sourceDataDefinition?: {
|
20
|
+
sourceDataReference: string;
|
21
|
+
filterDefinition?: any;
|
22
|
+
sortDefinition?: any;
|
23
|
+
};
|
24
|
+
}
|
25
|
+
export interface DataGroupingProperty {
|
26
|
+
propertyDefinition: TypeProperty;
|
27
|
+
values?: Array<string>;
|
28
|
+
typeRootSlug: string;
|
29
|
+
sort: string;
|
30
|
+
isSecondaryGroup?: boolean;
|
31
|
+
}
|
package/lib/interfaces.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/package.json
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
{
|
2
|
-
"name": "@contrail/data-grouping",
|
3
|
-
"version": "1.0.
|
4
|
-
"description": "Utilities and interfaces for grouping data into hierarchial data structures based on properties.",
|
5
|
-
"main": "lib/index.js",
|
6
|
-
"types": "lib/index.d.ts",
|
7
|
-
"scripts": {
|
8
|
-
"build": "tsc",
|
9
|
-
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
10
|
-
"lint": "tslint -p tsconfig.json",
|
11
|
-
"test": "jest"
|
12
|
-
},
|
13
|
-
"keywords": [],
|
14
|
-
"author": "",
|
15
|
-
"license": "ISC",
|
16
|
-
"devDependencies": {
|
17
|
-
"@contrail/util": "^1.0.
|
18
|
-
"@types/jest": "^29.5.2",
|
19
|
-
"jest": "^29.5.0",
|
20
|
-
"prettier": "^1.19.1",
|
21
|
-
"ts-jest": "^29.1.1",
|
22
|
-
"tslint": "^5.11.0",
|
23
|
-
"tslint-config-prettier": "^1.18.0",
|
24
|
-
"typescript": "^4.0.0"
|
25
|
-
},
|
26
|
-
"jest": {
|
27
|
-
"moduleFileExtensions": [
|
28
|
-
"js",
|
29
|
-
"json",
|
30
|
-
"ts"
|
31
|
-
],
|
32
|
-
"rootDir": "src",
|
33
|
-
"testRegex": ".spec.ts$",
|
34
|
-
"transform": {
|
35
|
-
"^.+\\.(t|j)s$": "ts-jest"
|
36
|
-
},
|
37
|
-
"coverageDirectory": "../coverage",
|
38
|
-
"testEnvironment": "node"
|
39
|
-
},
|
40
|
-
"dependencies": {
|
41
|
-
"@contrail/documents": "^1.0.38",
|
42
|
-
"@contrail/types": "^3.0.27"
|
43
|
-
}
|
44
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@contrail/data-grouping",
|
3
|
+
"version": "1.0.25",
|
4
|
+
"description": "Utilities and interfaces for grouping data into hierarchial data structures based on properties.",
|
5
|
+
"main": "lib/index.js",
|
6
|
+
"types": "lib/index.d.ts",
|
7
|
+
"scripts": {
|
8
|
+
"build": "tsc",
|
9
|
+
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
10
|
+
"lint": "tslint -p tsconfig.json",
|
11
|
+
"test": "jest"
|
12
|
+
},
|
13
|
+
"keywords": [],
|
14
|
+
"author": "",
|
15
|
+
"license": "ISC",
|
16
|
+
"devDependencies": {
|
17
|
+
"@contrail/util": "^1.0.62",
|
18
|
+
"@types/jest": "^29.5.2",
|
19
|
+
"jest": "^29.5.0",
|
20
|
+
"prettier": "^1.19.1",
|
21
|
+
"ts-jest": "^29.1.1",
|
22
|
+
"tslint": "^5.11.0",
|
23
|
+
"tslint-config-prettier": "^1.18.0",
|
24
|
+
"typescript": "^4.0.0"
|
25
|
+
},
|
26
|
+
"jest": {
|
27
|
+
"moduleFileExtensions": [
|
28
|
+
"js",
|
29
|
+
"json",
|
30
|
+
"ts"
|
31
|
+
],
|
32
|
+
"rootDir": "src",
|
33
|
+
"testRegex": ".spec.ts$",
|
34
|
+
"transform": {
|
35
|
+
"^.+\\.(t|j)s$": "ts-jest"
|
36
|
+
},
|
37
|
+
"coverageDirectory": "../coverage",
|
38
|
+
"testEnvironment": "node"
|
39
|
+
},
|
40
|
+
"dependencies": {
|
41
|
+
"@contrail/documents": "^1.0.38",
|
42
|
+
"@contrail/types": "^3.0.27"
|
43
|
+
}
|
44
|
+
}
|