@contrail/documents 1.0.102 → 1.0.103

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.
@@ -22,18 +22,18 @@ class DynamicTextUtil {
22
22
  }
23
23
  const formatter = new types_1.PropertyValueFormatter();
24
24
  if (displayFunction === DynamicTextDisplayFunction.AVERAGE) {
25
- memberValues = memberValues.filter(e => e !== null && e !== undefined && !isNaN(e));
25
+ memberValues = memberValues.filter(Number);
26
26
  text = formatter.formatValueForProperty(memberValues.reduce((a, b) => a + b, 0) / memberValues.length, property);
27
27
  }
28
28
  else if (displayFunction === DynamicTextDisplayFunction.SUM) {
29
- memberValues = memberValues.filter(e => e !== null && e !== undefined && !isNaN(e));
29
+ memberValues = memberValues.filter(Number);
30
30
  text = formatter.formatValueForProperty(memberValues.reduce((a, b) => a + b, 0), property);
31
31
  }
32
32
  else if (displayFunction === DynamicTextDisplayFunction.UNIQUE_ARRAY) {
33
33
  text = Array.from(new Set(memberValues
34
- .filter(e => e !== null && e !== undefined)
34
+ .filter((e) => e !== null && e !== undefined)
35
35
  .flat()
36
- .map(e => formatter.formatValueForProperty(e, property))))
36
+ .map((e) => formatter.formatValueForProperty(e, property))))
37
37
  .sort()
38
38
  .join(', ');
39
39
  }
@@ -45,11 +45,11 @@ class DynamicTextUtil {
45
45
  text = formatter.formatValueForProperty(memberValues[memberValues.length - 1], property);
46
46
  }
47
47
  else if (displayFunction === DynamicTextDisplayFunction.MIN) {
48
- memberValues = memberValues.filter(e => e !== null && e !== undefined);
48
+ memberValues = memberValues.filter((e) => e !== null && e !== undefined);
49
49
  text = formatter.formatValueForProperty(Math.min(...memberValues), property);
50
50
  }
51
51
  else if (displayFunction === DynamicTextDisplayFunction.MAX) {
52
- memberValues = memberValues.filter(e => e !== null && e !== undefined);
52
+ memberValues = memberValues.filter((e) => e !== null && e !== undefined);
53
53
  text = formatter.formatValueForProperty(Math.max(...memberValues), property);
54
54
  }
55
55
  return text;
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
- {
2
- "name": "@contrail/documents",
3
- "version": "1.0.102",
4
- "description": "Documents library for contrail platform",
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
- "@types/jest": "^29.5.2",
18
- "jest": "^29.5.0",
19
- "nanoid": "^3.2.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/actions": "^1.0.14",
42
- "@contrail/types": "^3.0.71",
43
- "@contrail/util": "^1.0.19",
44
- "reflect-metadata": "^0.1.13"
45
- }
46
- }
1
+ {
2
+ "name": "@contrail/documents",
3
+ "version": "1.0.103",
4
+ "description": "Documents library for contrail platform",
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
+ "@types/jest": "^29.5.2",
18
+ "jest": "^29.5.0",
19
+ "nanoid": "^3.2.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/actions": "^1.0.14",
42
+ "@contrail/types": "^3.0.71",
43
+ "@contrail/util": "^1.0.19",
44
+ "reflect-metadata": "^0.1.13"
45
+ }
46
+ }