@legalplace/prerenderx 2.5.5-beta → 2.5.5
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.
- package/dist/libs/OutputParser.js +4 -8
- package/package.json +5 -7
- package/src/libs/OutputParser.ts +2 -11
- package/CHANGELOG.md +0 -29
|
@@ -8,12 +8,6 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.parseDocumentNameWithVariables = exports.parseOutputWithVariables = exports.getRelatedVariablesValues = void 0;
|
|
11
|
-
var frenchNumber = function (value) {
|
|
12
|
-
var result = typeof value === 'number' ? value.toString() : value;
|
|
13
|
-
if (/^([0-9]+)\.([0-9]+)$/.test(result.trim()))
|
|
14
|
-
result = result.trim().replace('.', ',');
|
|
15
|
-
return result;
|
|
16
|
-
};
|
|
17
11
|
exports.getRelatedVariablesValues = function (optionId, index, variables, ovc, references) {
|
|
18
12
|
var variablesValues = {};
|
|
19
13
|
variables.forEach(function (currentVariableId) {
|
|
@@ -30,8 +24,10 @@ exports.getRelatedVariablesValues = function (optionId, index, variables, ovc, r
|
|
|
30
24
|
if (rootVariableParentRelations.children.options.includes(optionId) || rootVariableParentRelations.dependants.includes(optionId) || optionId === rootVariableParentId)
|
|
31
25
|
value = [value[index]];
|
|
32
26
|
var cleanValues = value.map(function (currentValue) {
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
27
|
+
if (typeof currentValue === 'number')
|
|
28
|
+
return currentValue.toString();
|
|
29
|
+
if (typeof currentValue === 'string')
|
|
30
|
+
return currentValue;
|
|
35
31
|
return '';
|
|
36
32
|
});
|
|
37
33
|
var currentVariableValue = cleanValues.length === 1 ? cleanValues[0] : cleanValues.join(', ');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/prerenderx",
|
|
3
|
-
"version": "2.5.5
|
|
3
|
+
"version": "2.5.5",
|
|
4
4
|
"description": "PrerenderX",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": "https://git.legalplace.eu/legalplace/prerenderx",
|
|
@@ -11,15 +11,13 @@
|
|
|
11
11
|
"lint": "tsc && eslint ./src/ --ext ts,js",
|
|
12
12
|
"lint:fix": "tsc && eslint 'src/**/*.{js,jsx,ts,tsx}' --fix",
|
|
13
13
|
"test": "jest",
|
|
14
|
-
"build": "tsc"
|
|
15
|
-
"release": "standard-version -a --no-verify"
|
|
14
|
+
"build": "tsc"
|
|
16
15
|
},
|
|
17
16
|
"dependencies": {
|
|
18
|
-
"@legalplace/lplogic": "2.1.6",
|
|
19
|
-
"@legalplace/models-v3-types": "3.5.1",
|
|
20
|
-
"@legalplace/referencesparser": "1.6.3",
|
|
17
|
+
"@legalplace/lplogic": "^2.1.6",
|
|
18
|
+
"@legalplace/models-v3-types": "^3.5.1",
|
|
19
|
+
"@legalplace/referencesparser": "^1.6.3",
|
|
21
20
|
"crypto": "^1.0.1",
|
|
22
|
-
"standard-version": "^9.3.1",
|
|
23
21
|
"typescript": "3.9.3"
|
|
24
22
|
},
|
|
25
23
|
"devDependencies": {
|
package/src/libs/OutputParser.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { Types } from '@legalplace/referencesparser'
|
|
2
2
|
import OVC_TYPE from './ovc.type'
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Parses number to correct french number format ("," instead of ".")
|
|
6
|
-
*/
|
|
7
|
-
const frenchNumber = (value: string | number) => {
|
|
8
|
-
let result = typeof value === 'number' ? value.toString() : value;
|
|
9
|
-
if (/^([0-9]+)\.([0-9]+)$/.test(result.trim()))
|
|
10
|
-
result = result.trim().replace('.', ',');
|
|
11
|
-
return result;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
4
|
/**
|
|
15
5
|
* Returns option's related variable values
|
|
16
6
|
* @param optionId Option's id
|
|
@@ -41,7 +31,8 @@ export const getRelatedVariablesValues: getRelatedVarsT = (optionId, index, vari
|
|
|
41
31
|
|
|
42
32
|
// Making sure all values are strings
|
|
43
33
|
const cleanValues = value.map(currentValue => {
|
|
44
|
-
if (
|
|
34
|
+
if (typeof currentValue === 'number') return currentValue.toString()
|
|
35
|
+
if (typeof currentValue === 'string') return currentValue
|
|
45
36
|
return ''
|
|
46
37
|
})
|
|
47
38
|
|
package/CHANGELOG.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
-
|
|
5
|
-
### [2.5.5](https://git.legalplace.eu/legalplace/prerenderx/compare/v2.6.3...v2.5.5) (2021-10-27)
|
|
6
|
-
|
|
7
|
-
### [2.6.3](https://git.legalplace.eu/legalplace/prerenderx/compare/v2.6.2...v2.6.3) (2021-10-04)
|
|
8
|
-
|
|
9
|
-
### [2.6.2](https://git.legalplace.eu/legalplace/prerenderx/compare/v2.2.0...v2.6.2) (2021-10-01)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
### Features
|
|
13
|
-
|
|
14
|
-
* adding french numbers displaying ([ffc1c1e](https://git.legalplace.eu/legalplace/prerenderx/commit/ffc1c1e4279dbd5d6529da0394cf03998fe1d4a3))
|
|
15
|
-
* bump version ([1b94156](https://git.legalplace.eu/legalplace/prerenderx/commit/1b941562c157e4ee368ca6ced106bf5c2d1dddd3))
|
|
16
|
-
* supporting parsed references ([39d5a8d](https://git.legalplace.eu/legalplace/prerenderx/commit/39d5a8d74fc9d9fd91936ab8d2c1edb9780e5afc))
|
|
17
|
-
* supporting parsed references and rendering documents on-demand. ([17ccbeb](https://git.legalplace.eu/legalplace/prerenderx/commit/17ccbeb8fe6ef4529864df955fd83fbe4911e252))
|
|
18
|
-
* Supporting variables in documents names ([da853c0](https://git.legalplace.eu/legalplace/prerenderx/commit/da853c0a1b0325d45570543195ada5f292645bad))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
### Bug Fixes
|
|
22
|
-
|
|
23
|
-
* add version logging ([4815571](https://git.legalplace.eu/legalplace/prerenderx/commit/4815571df9dbb1dc2a394683fe0bb16723eae57c))
|
|
24
|
-
* adding cache support for conditions ([34866b8](https://git.legalplace.eu/legalplace/prerenderx/commit/34866b8f7fc5b7e5d2bd1ff08dd50a80010c0262))
|
|
25
|
-
* bimp version ([f3fbd55](https://git.legalplace.eu/legalplace/prerenderx/commit/f3fbd55bba169a449a282c34c85fa48f98b03be5))
|
|
26
|
-
* datapopulator issue ([b8f8532](https://git.legalplace.eu/legalplace/prerenderx/commit/b8f8532fe7b03811e364387d3168c637d7bc6976))
|
|
27
|
-
* fixing cache ([53cf0dd](https://git.legalplace.eu/legalplace/prerenderx/commit/53cf0ddd2e1cd8c6c98c86869081aa949317f0cb))
|
|
28
|
-
* handle static chil in ovc converter ([5eadfab](https://git.legalplace.eu/legalplace/prerenderx/commit/5eadfab0aa8c0885f3e4268eb56c82e56e07d7ba))
|
|
29
|
-
* handle static child in prerender ([f6e6115](https://git.legalplace.eu/legalplace/prerenderx/commit/f6e6115f9d04bd585e0e05e52871217da9e1cf1b))
|