@omnia/velcron 8.0.310-dev → 8.0.311-dev
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/models/Enums.d.ts +2 -1
- package/models/Enums.js +1 -0
- package/package.json +1 -1
- package/parser/VelcronActions.js +3 -0
- package/parser/VelcronData.js +16 -0
- package/parser/VelcronDataBinder.js +1 -1
package/models/Enums.d.ts
CHANGED
package/models/Enums.js
CHANGED
|
@@ -10,6 +10,7 @@ var AssignOperators;
|
|
|
10
10
|
AssignOperators["plusPlus"] = "++";
|
|
11
11
|
AssignOperators["minusMinus"] = "--";
|
|
12
12
|
AssignOperators["equalsExclamation"] = "=!";
|
|
13
|
+
AssignOperators["equalsMinus"] = "=-";
|
|
13
14
|
})(AssignOperators || (exports.AssignOperators = AssignOperators = {}));
|
|
14
15
|
var VelcronActionTypes;
|
|
15
16
|
(function (VelcronActionTypes) {
|
package/package.json
CHANGED
package/parser/VelcronActions.js
CHANGED
|
@@ -195,6 +195,9 @@ class VelcronActions {
|
|
|
195
195
|
else if (partialTemplate.indexOf(models_1.AssignOperators.equalsPlus) > -1) {
|
|
196
196
|
assignOpIndex = partialTemplate.indexOf(models_1.AssignOperators.equalsPlus);
|
|
197
197
|
}
|
|
198
|
+
else if (partialTemplate.indexOf(models_1.AssignOperators.equalsMinus) > -1) {
|
|
199
|
+
assignOpIndex = partialTemplate.indexOf(models_1.AssignOperators.equalsMinus);
|
|
200
|
+
}
|
|
198
201
|
else if (partialTemplate.indexOf(models_1.AssignOperators.equalsQuestion) > -1) {
|
|
199
202
|
assignOpIndex = partialTemplate.indexOf(models_1.AssignOperators.equalsQuestion);
|
|
200
203
|
}
|
package/parser/VelcronData.js
CHANGED
|
@@ -298,6 +298,10 @@ class VelcronData {
|
|
|
298
298
|
assignOperator = models_1.AssignOperators.plusEquals;
|
|
299
299
|
path = path.substring(0, path.length - models_1.AssignOperators.plusEquals.length);
|
|
300
300
|
}
|
|
301
|
+
else if (path.endsWith(models_1.AssignOperators.equalsMinus)) {
|
|
302
|
+
assignOperator = models_1.AssignOperators.equalsMinus;
|
|
303
|
+
path = path.substring(0, path.length - models_1.AssignOperators.equalsMinus.length);
|
|
304
|
+
}
|
|
301
305
|
else if (path.endsWith(models_1.AssignOperators.equalsQuestion)) {
|
|
302
306
|
assignOperator = models_1.AssignOperators.equalsQuestion;
|
|
303
307
|
path = path.substring(0, path.length - models_1.AssignOperators.equalsQuestion.length);
|
|
@@ -457,6 +461,7 @@ class VelcronData {
|
|
|
457
461
|
template = assignOperator + path;
|
|
458
462
|
}
|
|
459
463
|
else if (assignOperator === models_1.AssignOperators.equalsPlus || assignOperator === models_1.AssignOperators.plusEquals) {
|
|
464
|
+
//Support adding items to array += unshifts or =+ pushes
|
|
460
465
|
if (Array.isArray(existingVal)) {
|
|
461
466
|
names.push("value");
|
|
462
467
|
obj.push(value);
|
|
@@ -469,6 +474,17 @@ class VelcronData {
|
|
|
469
474
|
}
|
|
470
475
|
}
|
|
471
476
|
}
|
|
477
|
+
else if (assignOperator === models_1.AssignOperators.equalsMinus) {
|
|
478
|
+
//Support removing items from array
|
|
479
|
+
if (Array.isArray(existingVal)) {
|
|
480
|
+
names.push("value");
|
|
481
|
+
obj.push(value);
|
|
482
|
+
template = `${path} = ${path}.filter(item => item !== value)`;
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
VelcronLogger_1.VelcronLogger.logDataError(`Attempted to remove value from a non-array property at path ${path}`);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
472
488
|
else if (assignOperator === models_1.AssignOperators.equalsQuestion) {
|
|
473
489
|
if (Array.isArray(existingVal)) {
|
|
474
490
|
//fix this
|
|
@@ -38,7 +38,7 @@ class VelcronDataBinder {
|
|
|
38
38
|
}
|
|
39
39
|
// String interpolation > {{ $state.title }} and {{ $state.description }}
|
|
40
40
|
// Computed String interpolation > {{@getName}}
|
|
41
|
-
return
|
|
41
|
+
return VelcronDataBinder.interpolateTokens(bindTo, renderContext);
|
|
42
42
|
}
|
|
43
43
|
static interpolateTokens(bindTo, renderContext) {
|
|
44
44
|
const tokens = VelcronData_1.VelcronData.getTokens(bindTo, false);
|