@signalplus/params-about 1.0.5-alpha3 → 1.0.5-alpha4
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/lib/es/index.js +9 -7
- package/package.json +1 -1
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bundle of @signalplus/params-about
|
|
3
|
-
* Generated: 2023-05-
|
|
4
|
-
* Version: 1.0.5-
|
|
3
|
+
* Generated: 2023-05-12
|
|
4
|
+
* Version: 1.0.5-alpha4
|
|
5
5
|
* License: MIT
|
|
6
6
|
* Author: 2631541504@qq.com
|
|
7
7
|
*/
|
|
@@ -260,7 +260,7 @@ function formatNum(val) {
|
|
|
260
260
|
return isNaN(num) ? undefined : num;
|
|
261
261
|
}
|
|
262
262
|
function isNullLike(val) {
|
|
263
|
-
return val === undefined || val === null;
|
|
263
|
+
return val === undefined || val === null || val === '';
|
|
264
264
|
}
|
|
265
265
|
function emptyValidator(val, enableEmpty) {
|
|
266
266
|
return !enableEmpty && (isNullLike(val) || val instanceof Array && !val.length || typeof val === 'string' && !val) ? 'Should not be empty' : '';
|
|
@@ -1660,16 +1660,17 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
|
|
|
1660
1660
|
for (var i = 0; i < $val.length; i++) {
|
|
1661
1661
|
var val = $val[i];
|
|
1662
1662
|
var error = expiryValidator(val === null || val === void 0 ? void 0 : val.expiry);
|
|
1663
|
+
if (isNullLike(val.expiry) && isNullLike(val.value)) return '';
|
|
1663
1664
|
|
|
1664
1665
|
if (error) {
|
|
1665
1666
|
return "Expiry field of the ".concat(i + 1, "th item: ").concat(error);
|
|
1666
1667
|
}
|
|
1667
1668
|
|
|
1668
|
-
if (
|
|
1669
|
+
if (isNullLike(val.expiry) && !isNullLike(val.value)) {
|
|
1669
1670
|
return "The ".concat(i + 1, "th item: expiry shold not be empty");
|
|
1670
1671
|
}
|
|
1671
1672
|
|
|
1672
|
-
if (isNullLike(val.expiry) &&
|
|
1673
|
+
if (!isNullLike(val.expiry) && isNullLike(val.value)) {
|
|
1673
1674
|
return "The ".concat(i + 1, "th item: value shold not be empty");
|
|
1674
1675
|
}
|
|
1675
1676
|
}
|
|
@@ -1723,12 +1724,13 @@ var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty(_ParamTypeConfig,
|
|
|
1723
1724
|
|
|
1724
1725
|
for (var i = 0; i < $val.length; i++) {
|
|
1725
1726
|
var val = $val[i];
|
|
1727
|
+
if (isNullLike(val.instrument) && isNullLike(val.value)) return '';
|
|
1726
1728
|
|
|
1727
|
-
if (
|
|
1729
|
+
if (isNullLike(val.instrument) && !isNullLike(val.value)) {
|
|
1728
1730
|
return "The ".concat(i + 1, "th item: instrument shold not be empty");
|
|
1729
1731
|
}
|
|
1730
1732
|
|
|
1731
|
-
if (isNullLike(val.instrument) &&
|
|
1733
|
+
if (!isNullLike(val.instrument) && isNullLike(val.value)) {
|
|
1732
1734
|
return "The ".concat(i + 1, "th item: value shold not be empty");
|
|
1733
1735
|
}
|
|
1734
1736
|
}
|