@inseefr/lunatic 2.7.21 → 2.7.23
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.
|
@@ -294,6 +294,11 @@ var LunaticVariable = /*#__PURE__*/function () {
|
|
|
294
294
|
if ((0, _env.isTestEnv)()) {
|
|
295
295
|
interpretCount++;
|
|
296
296
|
}
|
|
297
|
+
// Scale down iteration if its dimension > shapeFrom dimension
|
|
298
|
+
var shapeDimension = arrayDimension(shapeFromValue);
|
|
299
|
+
if (Array.isArray(iteration) && Array.isArray(shapeFromValue) && shapeDimension < iteration.length) {
|
|
300
|
+
iteration = iteration.slice(0, shapeDimension);
|
|
301
|
+
}
|
|
297
302
|
// Uncomment this if you want to track the number of calculation
|
|
298
303
|
// this.calculatedCount++;
|
|
299
304
|
// Remember the value
|
|
@@ -441,4 +446,10 @@ var LunaticVariable = /*#__PURE__*/function () {
|
|
|
441
446
|
}
|
|
442
447
|
}]);
|
|
443
448
|
return LunaticVariable;
|
|
444
|
-
}();
|
|
449
|
+
}();
|
|
450
|
+
function arrayDimension(arr) {
|
|
451
|
+
if (!Array.isArray(arr)) {
|
|
452
|
+
return 0;
|
|
453
|
+
}
|
|
454
|
+
return 1 + arrayDimension(arr[0]);
|
|
455
|
+
}
|
|
@@ -87,7 +87,7 @@ function isEmpty(value) {
|
|
|
87
87
|
if (_typeof(value) === 'object' && value !== null) {
|
|
88
88
|
return isEmpty(Object.values(value));
|
|
89
89
|
}
|
|
90
|
-
return (value !== null && value !== void 0 ? value : '') === '';
|
|
90
|
+
return (value !== null && value !== void 0 ? value : '') === '' || value === false;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inseefr/lunatic",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.23",
|
|
4
4
|
"workersVersion": "0.3.0",
|
|
5
5
|
"description": "Library of questionnaire components",
|
|
6
6
|
"repository": {
|
|
@@ -75,9 +75,6 @@
|
|
|
75
75
|
"antlr4": "4.11.0",
|
|
76
76
|
"classnames": "^2.3.1",
|
|
77
77
|
"date-fns": "^2.25.0",
|
|
78
|
-
"lodash.camelcase": "^4.3.0",
|
|
79
|
-
"lodash.debounce": "^4.0.8",
|
|
80
|
-
"lodash.isequal": "^4.5.0",
|
|
81
78
|
"object-hash": "^2.2.0",
|
|
82
79
|
"prop-types": "^15.7.2",
|
|
83
80
|
"react-keyboard-event-handler": "^1.5.4",
|