@signalplus/params-about 0.1.41 → 0.1.42
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 +7 -3
- 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
3
|
* Generated: 2022-04-19
|
|
4
|
-
* Version: 0.1.
|
|
4
|
+
* Version: 0.1.42
|
|
5
5
|
* License: MIT
|
|
6
6
|
* Author: 2631541504@qq.com
|
|
7
7
|
*/
|
|
@@ -281,9 +281,11 @@ function numRangeValidator(val, enableEmpty) {
|
|
|
281
281
|
return val.min > val.max ? 'Max should bigger than Min' : '';
|
|
282
282
|
}
|
|
283
283
|
function expiryValidator(val, enableEmpty) {
|
|
284
|
+
var _val$match;
|
|
285
|
+
|
|
284
286
|
var error = emptyValidator(val, enableEmpty);
|
|
285
287
|
if (error) return error;
|
|
286
|
-
var $val = dayjs(val, '
|
|
288
|
+
var $val = dayjs(((_val$match = val.match(/\d+|[a-zA-Z]+/g)) === null || _val$match === void 0 ? void 0 : _val$match.slice(0, 3).join('-')) || '', 'D-MMM-YY').format('DMMMYY').toUpperCase();
|
|
287
289
|
if ($val !== val) return 'Out of format';
|
|
288
290
|
return '';
|
|
289
291
|
}
|
|
@@ -316,9 +318,11 @@ function keyValidator(val, allKeys) {
|
|
|
316
318
|
return '';
|
|
317
319
|
}
|
|
318
320
|
function isExpired(val) {
|
|
321
|
+
var _val$match2;
|
|
322
|
+
|
|
319
323
|
if (!val) return false;
|
|
320
324
|
var now = dayjs();
|
|
321
|
-
var expiry = dayjs(
|
|
325
|
+
var expiry = dayjs(((_val$match2 = val.match(/\d+|[a-zA-Z]+/g)) === null || _val$match2 === void 0 ? void 0 : _val$match2.slice(0, 3).join('-')) || '', 'D-MMM-YY');
|
|
322
326
|
var expireTime = dayjs("".concat(expiry.format('YYYY-MM-DD'), "T08:00Z"));
|
|
323
327
|
return now >= expireTime;
|
|
324
328
|
}
|