@player-ui/common-expressions-plugin 0.12.0-next.5 → 0.12.0-next.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/CommonExpressionsPlugin.native.js +33 -2
- package/dist/CommonExpressionsPlugin.native.js.map +1 -1
- package/dist/cjs/index.cjs +31 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +31 -0
- package/dist/index.mjs +31 -0
- package/dist/index.mjs.map +1 -1
- package/dist/xlr/manifest.js +3 -1
- package/dist/xlr/manifest.json +2 -0
- package/dist/xlr/split.json +49 -0
- package/dist/xlr/substr.json +37 -0
- package/package.json +3 -3
- package/src/expressions/__tests__/expressions.test.ts +76 -12
- package/src/expressions/index.ts +50 -0
- package/src/index.ts +4 -0
- package/types/expressions/index.d.ts +2 -0
- package/types/index.d.ts +3 -1
|
@@ -2157,6 +2157,12 @@ var CommonExpressionsPlugin = function() {
|
|
|
2157
2157
|
size: function() {
|
|
2158
2158
|
return size;
|
|
2159
2159
|
},
|
|
2160
|
+
split: function() {
|
|
2161
|
+
return split;
|
|
2162
|
+
},
|
|
2163
|
+
substr: function() {
|
|
2164
|
+
return substr;
|
|
2165
|
+
},
|
|
2160
2166
|
sum: function() {
|
|
2161
2167
|
return sum;
|
|
2162
2168
|
},
|
|
@@ -2964,8 +2970,8 @@ var CommonExpressionsPlugin = function() {
|
|
|
2964
2970
|
return new _BindingInstance(rawBinding);
|
|
2965
2971
|
};
|
|
2966
2972
|
_class_call_check(this, _BindingInstance);
|
|
2967
|
-
var
|
|
2968
|
-
this.split =
|
|
2973
|
+
var split2 = Array.isArray(raw) ? raw : raw.split(".");
|
|
2974
|
+
this.split = split2.map(function(segment) {
|
|
2969
2975
|
if (typeof segment === "number") {
|
|
2970
2976
|
return segment;
|
|
2971
2977
|
}
|
|
@@ -7676,6 +7682,31 @@ var CommonExpressionsPlugin = function() {
|
|
|
7676
7682
|
return word.toUpperCase();
|
|
7677
7683
|
});
|
|
7678
7684
|
}));
|
|
7685
|
+
var split = withoutContext(function(str, separator, limit) {
|
|
7686
|
+
if (separator === void 0 || separator === null) {
|
|
7687
|
+
return str;
|
|
7688
|
+
}
|
|
7689
|
+
var separatorStr = String(separator);
|
|
7690
|
+
if (separatorStr === "") {
|
|
7691
|
+
var result2 = str.split("");
|
|
7692
|
+
if (limit !== void 0 && limit !== null && limit > 0) {
|
|
7693
|
+
return result2.slice(0, limit);
|
|
7694
|
+
}
|
|
7695
|
+
return result2;
|
|
7696
|
+
}
|
|
7697
|
+
var result = str.split(separatorStr);
|
|
7698
|
+
if (limit !== void 0 && limit !== null && limit > 0) {
|
|
7699
|
+
return result.slice(0, limit);
|
|
7700
|
+
}
|
|
7701
|
+
return result;
|
|
7702
|
+
});
|
|
7703
|
+
var substr = withoutContext(function(str, start, length2) {
|
|
7704
|
+
var actualStartIndex = start < 0 ? str.length + start : start;
|
|
7705
|
+
if (length2 !== void 0) {
|
|
7706
|
+
return str.substring(actualStartIndex, actualStartIndex + length2);
|
|
7707
|
+
}
|
|
7708
|
+
return str.substring(actualStartIndex);
|
|
7709
|
+
});
|
|
7679
7710
|
var number = withoutContext(toNum);
|
|
7680
7711
|
var round = withoutContext(function(num) {
|
|
7681
7712
|
var _toNum;
|