@legalplace/prerenderx 2.5.1 → 2.5.2
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/DataPopulator.js +2 -21
- package/package.json +3 -3
- package/src/libs/DataPopulator.ts +2 -19
|
@@ -102,7 +102,6 @@ var DataPopulator = (function () {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
DataPopulator.prototype.getVariableValues = function (variableId) {
|
|
105
|
-
var conditions = this.variableConditionValue(variableId);
|
|
106
105
|
var value = this.ovc.variables[variableId];
|
|
107
106
|
if (this.id === undefined || this.index === undefined) {
|
|
108
107
|
return value;
|
|
@@ -110,18 +109,9 @@ var DataPopulator = (function () {
|
|
|
110
109
|
var variableRootParent = this.getVariableRootParent(variableId);
|
|
111
110
|
var variableRootRelations = this.references.relations.options[variableRootParent];
|
|
112
111
|
if (variableRootRelations.children.options.includes(this.id) || variableRootRelations.dependants.includes(this.id) || this.id === variableRootParent) {
|
|
113
|
-
if (conditions !== undefined && conditions[this.index] === false)
|
|
114
|
-
return ['fAl$e'];
|
|
115
112
|
return [value[this.index]];
|
|
116
113
|
}
|
|
117
|
-
|
|
118
|
-
if (conditions === undefined)
|
|
119
|
-
return cleanValues;
|
|
120
|
-
return cleanValues.map(function (currentValue, index) {
|
|
121
|
-
if (conditions[index] === false)
|
|
122
|
-
return 'fAl$e';
|
|
123
|
-
return currentValue;
|
|
124
|
-
});
|
|
114
|
+
return this.cleanArrayFromNullValues(__spreadArrays(value));
|
|
125
115
|
};
|
|
126
116
|
DataPopulator.prototype.getVariableRootParent = function (variableId) {
|
|
127
117
|
var variableParents = this.references.relations.variables[variableId].parents;
|
|
@@ -138,7 +128,6 @@ var DataPopulator = (function () {
|
|
|
138
128
|
}
|
|
139
129
|
};
|
|
140
130
|
DataPopulator.prototype.getOptionInputs = function (optionId) {
|
|
141
|
-
var conditions = this.optionConditionValue(optionId);
|
|
142
131
|
var inputs = this.ovc.options[optionId];
|
|
143
132
|
if (this.id === undefined || this.index === undefined) {
|
|
144
133
|
return inputs;
|
|
@@ -146,17 +135,9 @@ var DataPopulator = (function () {
|
|
|
146
135
|
var optionRootParent = this.getOptionRootParent(optionId);
|
|
147
136
|
var optionRootRelations = this.references.relations.options[optionRootParent];
|
|
148
137
|
if (optionRootRelations.children.options.includes(this.id) || optionRootRelations.dependants.includes(this.id) || this.id === optionRootParent) {
|
|
149
|
-
if (conditions !== undefined && conditions[this.index] === false)
|
|
150
|
-
return [false];
|
|
151
138
|
return [inputs[this.index]];
|
|
152
139
|
}
|
|
153
|
-
|
|
154
|
-
return inputs;
|
|
155
|
-
return inputs.map(function (value, index) {
|
|
156
|
-
if (conditions[index] === false)
|
|
157
|
-
return false;
|
|
158
|
-
return value;
|
|
159
|
-
});
|
|
140
|
+
return inputs;
|
|
160
141
|
};
|
|
161
142
|
DataPopulator.prototype.getOptionRootParent = function (optionId) {
|
|
162
143
|
var optionParents = this.references.relations.options[optionId].parents;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/prerenderx",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.2",
|
|
4
4
|
"description": "PrerenderX",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": "https://git.legalplace.eu/legalplace/prerenderx",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"build": "tsc"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@legalplace/lplogic": "^2.1.
|
|
17
|
+
"@legalplace/lplogic": "^2.1.6",
|
|
18
18
|
"@legalplace/models-v3-types": "^3.4.47",
|
|
19
|
-
"@legalplace/referencesparser": "^1.
|
|
19
|
+
"@legalplace/referencesparser": "^1.6.1",
|
|
20
20
|
"crypto": "^1.0.1",
|
|
21
21
|
"typescript": "3.9.3"
|
|
22
22
|
},
|
|
@@ -160,7 +160,6 @@ class DataPopulator {
|
|
|
160
160
|
* @param variableId Variable's id
|
|
161
161
|
*/
|
|
162
162
|
private getVariableValues(variableId: number): Readonly<(string | number)[]> {
|
|
163
|
-
const conditions = this.variableConditionValue(variableId)
|
|
164
163
|
const value = this.ovc.variables[variableId]
|
|
165
164
|
if (this.id === undefined || this.index === undefined) {
|
|
166
165
|
return value
|
|
@@ -170,19 +169,10 @@ class DataPopulator {
|
|
|
170
169
|
const variableRootParent = this.getVariableRootParent(variableId)
|
|
171
170
|
const variableRootRelations = this.references.relations.options[variableRootParent]
|
|
172
171
|
if (variableRootRelations.children.options.includes(this.id) || variableRootRelations.dependants.includes(this.id) || this.id === variableRootParent) {
|
|
173
|
-
// TODO: Replace fAl$e with a safer solution
|
|
174
|
-
if (conditions !== undefined && conditions[this.index] === false) return ['fAl$e']
|
|
175
172
|
return [value[this.index]]
|
|
176
173
|
}
|
|
177
174
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (conditions === undefined) return cleanValues
|
|
181
|
-
|
|
182
|
-
return cleanValues.map((currentValue, index) => {
|
|
183
|
-
if (conditions[index] === false) return 'fAl$e'
|
|
184
|
-
return currentValue
|
|
185
|
-
})
|
|
175
|
+
return this.cleanArrayFromNullValues([...value])
|
|
186
176
|
}
|
|
187
177
|
|
|
188
178
|
/**
|
|
@@ -221,7 +211,6 @@ class DataPopulator {
|
|
|
221
211
|
* @param optionId Option's id
|
|
222
212
|
*/
|
|
223
213
|
private getOptionInputs(optionId: number): Readonly<boolean[]> {
|
|
224
|
-
const conditions = this.optionConditionValue(optionId)
|
|
225
214
|
const inputs = this.ovc.options[optionId]
|
|
226
215
|
if (this.id === undefined || this.index === undefined) {
|
|
227
216
|
return inputs
|
|
@@ -231,16 +220,10 @@ class DataPopulator {
|
|
|
231
220
|
const optionRootParent = this.getOptionRootParent(optionId)
|
|
232
221
|
const optionRootRelations = this.references.relations.options[optionRootParent]
|
|
233
222
|
if (optionRootRelations.children.options.includes(this.id) || optionRootRelations.dependants.includes(this.id) || this.id === optionRootParent) {
|
|
234
|
-
if (conditions !== undefined && conditions[this.index] === false) return [false]
|
|
235
223
|
return [inputs[this.index]]
|
|
236
224
|
}
|
|
237
225
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
return inputs.map((value, index) => {
|
|
241
|
-
if (conditions[index] === false) return false
|
|
242
|
-
return value
|
|
243
|
-
})
|
|
226
|
+
return inputs
|
|
244
227
|
}
|
|
245
228
|
|
|
246
229
|
/**
|