@legalplace/conditions-runner 2.3.0 → 2.3.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.3.1](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/conditions-runner@2.3.0...@legalplace/conditions-runner@2.3.1) (2026-09-01)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * prevent LpLogic cleanString crash on null related-row values ([c07292d](https://git.legalplace.eu/legalplace/monorepo/commits/c07292d1ccdb615ee4ab885cafea10d6b08f479e))
12
+
13
+
14
+
15
+
16
+
6
17
  # [2.3.0](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/conditions-runner@2.2.20...@legalplace/conditions-runner@2.3.0) (2026-09-01)
7
18
 
8
19
 
@@ -95,14 +95,14 @@ class DataPopulator {
95
95
  getVariableValues(variableId) {
96
96
  const value = this.ovc.variables[variableId] || [];
97
97
  if (this.id === undefined || this.index === undefined) {
98
- return value;
98
+ return this.cleanArrayFromNullValues([...value]);
99
99
  }
100
100
  const variableRootParent = this.getVariableRootParent(variableId);
101
101
  const variableRootRelations = this.references.relations.options[variableRootParent];
102
102
  if (variableRootRelations.children.options.includes(this.id) ||
103
103
  variableRootRelations.dependants.includes(this.id) ||
104
104
  this.id === variableRootParent) {
105
- return [value[this.index]];
105
+ return this.cleanArrayFromNullValues([value[this.index]]);
106
106
  }
107
107
  return this.cleanArrayFromNullValues([...value]);
108
108
  }
@@ -111,7 +111,7 @@ class DataPopulator {
111
111
  return variableParents[variableParents.length - 1];
112
112
  }
113
113
  cleanArrayFromNullValues(arr) {
114
- return arr.map((v) => (v === null ? "" : v));
114
+ return arr.map((v) => (v === null || v === undefined ? "" : v));
115
115
  }
116
116
  populateOptions() {
117
117
  for (let i = 0; i < this.dataMap.o.length; i += 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/conditions-runner",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Package containing method to execute conditions",
5
5
  "license": "MIT",
6
6
  "main": "dist/ConditionsRunner.js",
@@ -21,14 +21,14 @@
21
21
  },
22
22
  "prettier": "@legalplace/prettier-config",
23
23
  "dependencies": {
24
- "@legalplace/lplogic": "2.3.3",
24
+ "@legalplace/lplogic": "2.3.4",
25
25
  "@legalplace/models-v3-types": "^5.18.0",
26
- "@legalplace/referencesparser": "^3.3.0"
26
+ "@legalplace/referencesparser": "^3.3.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@legalplace/prettier-config": "^2.1.3",
30
30
  "@legalplace/types": "^2.22.13",
31
31
  "ts-node": "^10.8.1"
32
32
  },
33
- "gitHead": "5b5eed67e9a7815f5fa77492782158fa6af0ca13"
33
+ "gitHead": "fea2ae8e98c1d0e7595f0740400d9d339954d2fa"
34
34
  }
@@ -169,7 +169,7 @@ class DataPopulator {
169
169
  private getVariableValues(variableId: number): Readonly<(string | number)[]> {
170
170
  const value = this.ovc.variables[variableId] || [];
171
171
  if (this.id === undefined || this.index === undefined) {
172
- return value;
172
+ return this.cleanArrayFromNullValues([...value]);
173
173
  }
174
174
 
175
175
  // Getting variable parent option
@@ -181,7 +181,7 @@ class DataPopulator {
181
181
  variableRootRelations.dependants.includes(this.id) ||
182
182
  this.id === variableRootParent
183
183
  ) {
184
- return [value[this.index]];
184
+ return this.cleanArrayFromNullValues([value[this.index]]);
185
185
  }
186
186
 
187
187
  return this.cleanArrayFromNullValues([...value]);
@@ -203,9 +203,9 @@ class DataPopulator {
203
203
  * @param arr Values array
204
204
  */
205
205
  private cleanArrayFromNullValues(
206
- arr: (string | number | null)[]
206
+ arr: (string | number | null | undefined)[]
207
207
  ): (string | number)[] {
208
- return arr.map((v) => (v === null ? "" : v));
208
+ return arr.map((v) => (v === null || v === undefined ? "" : v));
209
209
  }
210
210
 
211
211
  /**