@legalplace/tagextractor 1.1.5 → 1.1.7

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