amis-formula 1.2.6 → 1.2.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.
- package/dist/index.js +8 -2
- 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.7
|
|
3
3
|
* Copyright 2021 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -3163,7 +3163,12 @@ var filters = {
|
|
|
3163
3163
|
length = parseInt(length, 10) || 200;
|
|
3164
3164
|
return input.substring(0, length) + (input.length > length ? end : '');
|
|
3165
3165
|
},
|
|
3166
|
-
url_encode: function (input) {
|
|
3166
|
+
url_encode: function (input) {
|
|
3167
|
+
if (input == null) {
|
|
3168
|
+
return '';
|
|
3169
|
+
}
|
|
3170
|
+
return encodeURIComponent(input);
|
|
3171
|
+
},
|
|
3167
3172
|
url_decode: function (input) { return decodeURIComponent(input); },
|
|
3168
3173
|
default: function (input, defaultValue, strict) {
|
|
3169
3174
|
var _a;
|
|
@@ -3477,6 +3482,7 @@ function skipRestTest(restFilters) {
|
|
|
3477
3482
|
}
|
|
3478
3483
|
function registerFilter(name, fn) {
|
|
3479
3484
|
filters[name] = fn;
|
|
3485
|
+
Evaluator.setDefaultFilters(filters);
|
|
3480
3486
|
}
|
|
3481
3487
|
function getFilters() {
|
|
3482
3488
|
return filters;
|