amis-formula 1.2.8 → 1.2.9
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/index.js +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-formula v1.2.
|
|
2
|
+
* amis-formula v1.2.9
|
|
3
3
|
* Copyright 2021 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -1267,7 +1267,8 @@ var Evaluator = /** @class */ (function () {
|
|
|
1267
1267
|
Evaluator.prototype.script = function (ast) {
|
|
1268
1268
|
var _a;
|
|
1269
1269
|
var defaultFilter = this.options.defaultFilter;
|
|
1270
|
-
|
|
1270
|
+
// 只给简单的变量取值用法自动补fitler
|
|
1271
|
+
if (defaultFilter && ~['getter', 'variable'].indexOf((_a = ast.body) === null || _a === void 0 ? void 0 : _a.type)) {
|
|
1271
1272
|
ast.body = {
|
|
1272
1273
|
type: 'filter',
|
|
1273
1274
|
input: ast.body,
|
|
@@ -4842,7 +4843,7 @@ var filters = {
|
|
|
4842
4843
|
};
|
|
4843
4844
|
function conditionalFilter(input, hasAlternate, filterContext, test, trueValue, falseValue) {
|
|
4844
4845
|
var _a;
|
|
4845
|
-
hasAlternate && skipRestTest(filterContext.restFilters);
|
|
4846
|
+
(hasAlternate || test) && skipRestTest(filterContext.restFilters);
|
|
4846
4847
|
var result = test ? trueValue : falseValue;
|
|
4847
4848
|
return test || hasAlternate
|
|
4848
4849
|
? (_a = getStrOrVariable(result, filterContext.data)) !== null && _a !== void 0 ? _a : result
|