@tmagic/utils 1.0.0-beta.10 → 1.0.0-beta.13
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/coverage/clover.xml +115 -0
- package/coverage/coverage-final.json +2 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +116 -0
- package/coverage/lcov-report/index.ts.html +715 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +206 -0
- package/dist/tmagic-utils.es.js +115 -91
- package/dist/tmagic-utils.es.js.map +1 -1
- package/dist/tmagic-utils.umd.js +117 -92
- package/dist/tmagic-utils.umd.js.map +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/package.json +15 -3
- package/src/index.ts +5 -1
- package/tsconfig.json +0 -9
- package/vite.config.ts +0 -45
package/dist/tmagic-utils.umd.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
7
|
//! moment.js
|
|
8
|
-
//! version : 2.29.
|
|
8
|
+
//! version : 2.29.2
|
|
9
9
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
10
10
|
//! license : MIT
|
|
11
11
|
//! momentjs.com
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
return input === void 0;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
function isNumber(input) {
|
|
63
|
+
function isNumber$1(input) {
|
|
64
64
|
return (
|
|
65
65
|
typeof input === 'number' ||
|
|
66
66
|
Object.prototype.toString.call(input) === '[object Number]'
|
|
@@ -76,8 +76,9 @@
|
|
|
76
76
|
|
|
77
77
|
function map(arr, fn) {
|
|
78
78
|
var res = [],
|
|
79
|
-
i
|
|
80
|
-
|
|
79
|
+
i,
|
|
80
|
+
arrLen = arr.length;
|
|
81
|
+
for (i = 0; i < arrLen; ++i) {
|
|
81
82
|
res.push(fn(arr[i], i));
|
|
82
83
|
}
|
|
83
84
|
return res;
|
|
@@ -206,7 +207,10 @@
|
|
|
206
207
|
updateInProgress = false;
|
|
207
208
|
|
|
208
209
|
function copyConfig(to, from) {
|
|
209
|
-
var i,
|
|
210
|
+
var i,
|
|
211
|
+
prop,
|
|
212
|
+
val,
|
|
213
|
+
momentPropertiesLen = momentProperties.length;
|
|
210
214
|
|
|
211
215
|
if (!isUndefined(from._isAMomentObject)) {
|
|
212
216
|
to._isAMomentObject = from._isAMomentObject;
|
|
@@ -239,8 +243,8 @@
|
|
|
239
243
|
to._locale = from._locale;
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
if (
|
|
243
|
-
for (i = 0; i <
|
|
246
|
+
if (momentPropertiesLen > 0) {
|
|
247
|
+
for (i = 0; i < momentPropertiesLen; i++) {
|
|
244
248
|
prop = momentProperties[i];
|
|
245
249
|
val = from[prop];
|
|
246
250
|
if (!isUndefined(val)) {
|
|
@@ -295,8 +299,9 @@
|
|
|
295
299
|
var args = [],
|
|
296
300
|
arg,
|
|
297
301
|
i,
|
|
298
|
-
key
|
|
299
|
-
|
|
302
|
+
key,
|
|
303
|
+
argLen = arguments.length;
|
|
304
|
+
for (i = 0; i < argLen; i++) {
|
|
300
305
|
arg = '';
|
|
301
306
|
if (typeof arguments[i] === 'object') {
|
|
302
307
|
arg += '\n[' + i + '] ';
|
|
@@ -446,7 +451,8 @@
|
|
|
446
451
|
);
|
|
447
452
|
}
|
|
448
453
|
|
|
449
|
-
var formattingTokens =
|
|
454
|
+
var formattingTokens =
|
|
455
|
+
/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
|
|
450
456
|
localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
|
|
451
457
|
formatFunctions = {},
|
|
452
458
|
formatTokenFunctions = {};
|
|
@@ -750,8 +756,9 @@
|
|
|
750
756
|
if (typeof units === 'object') {
|
|
751
757
|
units = normalizeObjectUnits(units);
|
|
752
758
|
var prioritized = getPrioritizedUnits(units),
|
|
753
|
-
i
|
|
754
|
-
|
|
759
|
+
i,
|
|
760
|
+
prioritizedLen = prioritized.length;
|
|
761
|
+
for (i = 0; i < prioritizedLen; i++) {
|
|
755
762
|
this[prioritized[i].unit](units[prioritized[i].unit]);
|
|
756
763
|
}
|
|
757
764
|
} else {
|
|
@@ -781,7 +788,8 @@
|
|
|
781
788
|
matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
|
|
782
789
|
// any word (or two) characters or numbers including two/three word month in arabic.
|
|
783
790
|
// includes scottish gaelic two word and hyphenated months
|
|
784
|
-
matchWord =
|
|
791
|
+
matchWord =
|
|
792
|
+
/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
|
|
785
793
|
regexes;
|
|
786
794
|
|
|
787
795
|
regexes = {};
|
|
@@ -807,15 +815,12 @@
|
|
|
807
815
|
return regexEscape(
|
|
808
816
|
s
|
|
809
817
|
.replace('\\', '')
|
|
810
|
-
.replace(
|
|
811
|
-
|
|
812
|
-
p1,
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
) {
|
|
817
|
-
return p1 || p2 || p3 || p4;
|
|
818
|
-
})
|
|
818
|
+
.replace(
|
|
819
|
+
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
|
820
|
+
function (matched, p1, p2, p3, p4) {
|
|
821
|
+
return p1 || p2 || p3 || p4;
|
|
822
|
+
}
|
|
823
|
+
)
|
|
819
824
|
);
|
|
820
825
|
}
|
|
821
826
|
|
|
@@ -827,16 +832,18 @@
|
|
|
827
832
|
|
|
828
833
|
function addParseToken(token, callback) {
|
|
829
834
|
var i,
|
|
830
|
-
func = callback
|
|
835
|
+
func = callback,
|
|
836
|
+
tokenLen;
|
|
831
837
|
if (typeof token === 'string') {
|
|
832
838
|
token = [token];
|
|
833
839
|
}
|
|
834
|
-
if (isNumber(callback)) {
|
|
840
|
+
if (isNumber$1(callback)) {
|
|
835
841
|
func = function (input, array) {
|
|
836
842
|
array[callback] = toInt(input);
|
|
837
843
|
};
|
|
838
844
|
}
|
|
839
|
-
|
|
845
|
+
tokenLen = token.length;
|
|
846
|
+
for (i = 0; i < tokenLen; i++) {
|
|
840
847
|
tokens[token[i]] = func;
|
|
841
848
|
}
|
|
842
849
|
}
|
|
@@ -947,12 +954,12 @@
|
|
|
947
954
|
|
|
948
955
|
// LOCALES
|
|
949
956
|
|
|
950
|
-
var defaultLocaleMonths =
|
|
951
|
-
'
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
957
|
+
var defaultLocaleMonths =
|
|
958
|
+
'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
|
959
|
+
'_'
|
|
960
|
+
),
|
|
961
|
+
defaultLocaleMonthsShort =
|
|
962
|
+
'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
|
956
963
|
MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
|
|
957
964
|
defaultMonthsShortRegex = matchWord,
|
|
958
965
|
defaultMonthsRegex = matchWord;
|
|
@@ -1101,7 +1108,7 @@
|
|
|
1101
1108
|
} else {
|
|
1102
1109
|
value = mom.localeData().monthsParse(value);
|
|
1103
1110
|
// TODO: Another silent failure?
|
|
1104
|
-
if (!isNumber(value)) {
|
|
1111
|
+
if (!isNumber$1(value)) {
|
|
1105
1112
|
return mom;
|
|
1106
1113
|
}
|
|
1107
1114
|
}
|
|
@@ -1394,14 +1401,12 @@
|
|
|
1394
1401
|
addRegexToken('W', match1to2);
|
|
1395
1402
|
addRegexToken('WW', match1to2, match2);
|
|
1396
1403
|
|
|
1397
|
-
addWeekParseToken(
|
|
1398
|
-
|
|
1399
|
-
week,
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
)
|
|
1403
|
-
week[token.substr(0, 1)] = toInt(input);
|
|
1404
|
-
});
|
|
1404
|
+
addWeekParseToken(
|
|
1405
|
+
['w', 'ww', 'W', 'WW'],
|
|
1406
|
+
function (input, week, config, token) {
|
|
1407
|
+
week[token.substr(0, 1)] = toInt(input);
|
|
1408
|
+
}
|
|
1409
|
+
);
|
|
1405
1410
|
|
|
1406
1411
|
// HELPERS
|
|
1407
1412
|
|
|
@@ -1526,9 +1531,8 @@
|
|
|
1526
1531
|
return ws.slice(n, 7).concat(ws.slice(0, n));
|
|
1527
1532
|
}
|
|
1528
1533
|
|
|
1529
|
-
var defaultLocaleWeekdays =
|
|
1530
|
-
'_'
|
|
1531
|
-
),
|
|
1534
|
+
var defaultLocaleWeekdays =
|
|
1535
|
+
'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
|
|
1532
1536
|
defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
|
1533
1537
|
defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
|
1534
1538
|
defaultWeekdaysRegex = matchWord,
|
|
@@ -2076,6 +2080,11 @@
|
|
|
2076
2080
|
return globalLocale;
|
|
2077
2081
|
}
|
|
2078
2082
|
|
|
2083
|
+
function isLocaleNameSane(name) {
|
|
2084
|
+
// Prevent names that look like filesystem paths, i.e contain '/' or '\'
|
|
2085
|
+
return name.match('^[^/\\\\]*$') != null;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2079
2088
|
function loadLocale(name) {
|
|
2080
2089
|
var oldLocale = null,
|
|
2081
2090
|
aliasedRequire;
|
|
@@ -2084,7 +2093,8 @@
|
|
|
2084
2093
|
locales[name] === undefined &&
|
|
2085
2094
|
typeof module !== 'undefined' &&
|
|
2086
2095
|
module &&
|
|
2087
|
-
module.exports
|
|
2096
|
+
module.exports &&
|
|
2097
|
+
isLocaleNameSane(name)
|
|
2088
2098
|
) {
|
|
2089
2099
|
try {
|
|
2090
2100
|
oldLocale = globalLocale._abbr;
|
|
@@ -2301,8 +2311,10 @@
|
|
|
2301
2311
|
|
|
2302
2312
|
// iso 8601 regex
|
|
2303
2313
|
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
|
|
2304
|
-
var extendedIsoRegex =
|
|
2305
|
-
|
|
2314
|
+
var extendedIsoRegex =
|
|
2315
|
+
/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
|
|
2316
|
+
basicIsoRegex =
|
|
2317
|
+
/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
|
|
2306
2318
|
tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
|
|
2307
2319
|
isoDates = [
|
|
2308
2320
|
['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
|
|
@@ -2333,7 +2345,8 @@
|
|
|
2333
2345
|
],
|
|
2334
2346
|
aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
|
|
2335
2347
|
// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
|
|
2336
|
-
rfc2822 =
|
|
2348
|
+
rfc2822 =
|
|
2349
|
+
/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
|
|
2337
2350
|
obsOffsets = {
|
|
2338
2351
|
UT: 0,
|
|
2339
2352
|
GMT: 0,
|
|
@@ -2356,12 +2369,13 @@
|
|
|
2356
2369
|
allowTime,
|
|
2357
2370
|
dateFormat,
|
|
2358
2371
|
timeFormat,
|
|
2359
|
-
tzFormat
|
|
2372
|
+
tzFormat,
|
|
2373
|
+
isoDatesLen = isoDates.length,
|
|
2374
|
+
isoTimesLen = isoTimes.length;
|
|
2360
2375
|
|
|
2361
2376
|
if (match) {
|
|
2362
2377
|
getParsingFlags(config).iso = true;
|
|
2363
|
-
|
|
2364
|
-
for (i = 0, l = isoDates.length; i < l; i++) {
|
|
2378
|
+
for (i = 0, l = isoDatesLen; i < l; i++) {
|
|
2365
2379
|
if (isoDates[i][1].exec(match[1])) {
|
|
2366
2380
|
dateFormat = isoDates[i][0];
|
|
2367
2381
|
allowTime = isoDates[i][2] !== false;
|
|
@@ -2373,7 +2387,7 @@
|
|
|
2373
2387
|
return;
|
|
2374
2388
|
}
|
|
2375
2389
|
if (match[3]) {
|
|
2376
|
-
for (i = 0, l =
|
|
2390
|
+
for (i = 0, l = isoTimesLen; i < l; i++) {
|
|
2377
2391
|
if (isoTimes[i][1].exec(match[3])) {
|
|
2378
2392
|
// match[2] should be 'T' or space
|
|
2379
2393
|
timeFormat = (match[2] || ' ') + isoTimes[i][0];
|
|
@@ -2753,12 +2767,13 @@
|
|
|
2753
2767
|
skipped,
|
|
2754
2768
|
stringLength = string.length,
|
|
2755
2769
|
totalParsedInputLength = 0,
|
|
2756
|
-
era
|
|
2770
|
+
era,
|
|
2771
|
+
tokenLen;
|
|
2757
2772
|
|
|
2758
2773
|
tokens =
|
|
2759
2774
|
expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
|
2760
|
-
|
|
2761
|
-
for (i = 0; i <
|
|
2775
|
+
tokenLen = tokens.length;
|
|
2776
|
+
for (i = 0; i < tokenLen; i++) {
|
|
2762
2777
|
token = tokens[i];
|
|
2763
2778
|
parsedInput = (string.match(getParseRegexForToken(token, config)) ||
|
|
2764
2779
|
[])[0];
|
|
@@ -2853,15 +2868,16 @@
|
|
|
2853
2868
|
i,
|
|
2854
2869
|
currentScore,
|
|
2855
2870
|
validFormatFound,
|
|
2856
|
-
bestFormatIsValid = false
|
|
2871
|
+
bestFormatIsValid = false,
|
|
2872
|
+
configfLen = config._f.length;
|
|
2857
2873
|
|
|
2858
|
-
if (
|
|
2874
|
+
if (configfLen === 0) {
|
|
2859
2875
|
getParsingFlags(config).invalidFormat = true;
|
|
2860
2876
|
config._d = new Date(NaN);
|
|
2861
2877
|
return;
|
|
2862
2878
|
}
|
|
2863
2879
|
|
|
2864
|
-
for (i = 0; i <
|
|
2880
|
+
for (i = 0; i < configfLen; i++) {
|
|
2865
2881
|
currentScore = 0;
|
|
2866
2882
|
validFormatFound = false;
|
|
2867
2883
|
tempConfig = copyConfig({}, config);
|
|
@@ -2982,7 +2998,7 @@
|
|
|
2982
2998
|
configFromArray(config);
|
|
2983
2999
|
} else if (isObject(input)) {
|
|
2984
3000
|
configFromObject(config);
|
|
2985
|
-
} else if (isNumber(input)) {
|
|
3001
|
+
} else if (isNumber$1(input)) {
|
|
2986
3002
|
// from milliseconds
|
|
2987
3003
|
config._d = new Date(input);
|
|
2988
3004
|
} else {
|
|
@@ -3102,7 +3118,8 @@
|
|
|
3102
3118
|
function isDurationValid(m) {
|
|
3103
3119
|
var key,
|
|
3104
3120
|
unitHasDecimal = false,
|
|
3105
|
-
i
|
|
3121
|
+
i,
|
|
3122
|
+
orderLen = ordering.length;
|
|
3106
3123
|
for (key in m) {
|
|
3107
3124
|
if (
|
|
3108
3125
|
hasOwnProp(m, key) &&
|
|
@@ -3115,7 +3132,7 @@
|
|
|
3115
3132
|
}
|
|
3116
3133
|
}
|
|
3117
3134
|
|
|
3118
|
-
for (i = 0; i <
|
|
3135
|
+
for (i = 0; i < orderLen; ++i) {
|
|
3119
3136
|
if (m[ordering[i]]) {
|
|
3120
3137
|
if (unitHasDecimal) {
|
|
3121
3138
|
return false; // only allow non-integers for smallest unit
|
|
@@ -3440,7 +3457,8 @@
|
|
|
3440
3457
|
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
|
|
3441
3458
|
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
|
|
3442
3459
|
// and further modified to allow for strings containing both week and day
|
|
3443
|
-
isoRegex =
|
|
3460
|
+
isoRegex =
|
|
3461
|
+
/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
|
3444
3462
|
|
|
3445
3463
|
function createDuration(input, key) {
|
|
3446
3464
|
var duration = input,
|
|
@@ -3456,7 +3474,7 @@
|
|
|
3456
3474
|
d: input._days,
|
|
3457
3475
|
M: input._months,
|
|
3458
3476
|
};
|
|
3459
|
-
} else if (isNumber(input) || !isNaN(+input)) {
|
|
3477
|
+
} else if (isNumber$1(input) || !isNaN(+input)) {
|
|
3460
3478
|
duration = {};
|
|
3461
3479
|
if (key) {
|
|
3462
3480
|
duration[key] = +input;
|
|
@@ -3623,7 +3641,7 @@
|
|
|
3623
3641
|
isMoment(input) ||
|
|
3624
3642
|
isDate(input) ||
|
|
3625
3643
|
isString(input) ||
|
|
3626
|
-
isNumber(input) ||
|
|
3644
|
+
isNumber$1(input) ||
|
|
3627
3645
|
isNumberOrStringArray(input) ||
|
|
3628
3646
|
isMomentInputObject(input) ||
|
|
3629
3647
|
input === null ||
|
|
@@ -3661,9 +3679,10 @@
|
|
|
3661
3679
|
'ms',
|
|
3662
3680
|
],
|
|
3663
3681
|
i,
|
|
3664
|
-
property
|
|
3682
|
+
property,
|
|
3683
|
+
propertyLen = properties.length;
|
|
3665
3684
|
|
|
3666
|
-
for (i = 0; i <
|
|
3685
|
+
for (i = 0; i < propertyLen; i += 1) {
|
|
3667
3686
|
property = properties[i];
|
|
3668
3687
|
propertyTest = propertyTest || hasOwnProp(input, property);
|
|
3669
3688
|
}
|
|
@@ -3677,7 +3696,7 @@
|
|
|
3677
3696
|
if (arrayTest) {
|
|
3678
3697
|
dataTypeTest =
|
|
3679
3698
|
input.filter(function (item) {
|
|
3680
|
-
return !isNumber(item) && isString(input);
|
|
3699
|
+
return !isNumber$1(item) && isString(input);
|
|
3681
3700
|
}).length === 0;
|
|
3682
3701
|
}
|
|
3683
3702
|
return arrayTest && dataTypeTest;
|
|
@@ -4286,19 +4305,17 @@
|
|
|
4286
4305
|
addRegexToken('NNNN', matchEraName);
|
|
4287
4306
|
addRegexToken('NNNNN', matchEraNarrow);
|
|
4288
4307
|
|
|
4289
|
-
addParseToken(
|
|
4290
|
-
|
|
4291
|
-
array,
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
} else {
|
|
4299
|
-
getParsingFlags(config).invalidEra = input;
|
|
4308
|
+
addParseToken(
|
|
4309
|
+
['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
|
|
4310
|
+
function (input, array, config, token) {
|
|
4311
|
+
var era = config._locale.erasParse(input, token, config._strict);
|
|
4312
|
+
if (era) {
|
|
4313
|
+
getParsingFlags(config).era = era;
|
|
4314
|
+
} else {
|
|
4315
|
+
getParsingFlags(config).invalidEra = input;
|
|
4316
|
+
}
|
|
4300
4317
|
}
|
|
4301
|
-
|
|
4318
|
+
);
|
|
4302
4319
|
|
|
4303
4320
|
addRegexToken('y', matchUnsigned);
|
|
4304
4321
|
addRegexToken('yy', matchUnsigned);
|
|
@@ -4590,14 +4607,12 @@
|
|
|
4590
4607
|
addRegexToken('GGGGG', match1to6, match6);
|
|
4591
4608
|
addRegexToken('ggggg', match1to6, match6);
|
|
4592
4609
|
|
|
4593
|
-
addWeekParseToken(
|
|
4594
|
-
|
|
4595
|
-
week,
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
)
|
|
4599
|
-
week[token.substr(0, 2)] = toInt(input);
|
|
4600
|
-
});
|
|
4610
|
+
addWeekParseToken(
|
|
4611
|
+
['gggg', 'ggggg', 'GGGG', 'GGGGG'],
|
|
4612
|
+
function (input, week, config, token) {
|
|
4613
|
+
week[token.substr(0, 2)] = toInt(input);
|
|
4614
|
+
}
|
|
4615
|
+
);
|
|
4601
4616
|
|
|
4602
4617
|
addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
|
|
4603
4618
|
week[token] = hooks.parseTwoDigitYear(input);
|
|
@@ -5037,7 +5052,7 @@
|
|
|
5037
5052
|
}
|
|
5038
5053
|
|
|
5039
5054
|
function listMonthsImpl(format, index, field) {
|
|
5040
|
-
if (isNumber(format)) {
|
|
5055
|
+
if (isNumber$1(format)) {
|
|
5041
5056
|
index = format;
|
|
5042
5057
|
format = undefined;
|
|
5043
5058
|
}
|
|
@@ -5066,7 +5081,7 @@
|
|
|
5066
5081
|
// (true, fmt)
|
|
5067
5082
|
function listWeekdaysImpl(localeSorted, format, index, field) {
|
|
5068
5083
|
if (typeof localeSorted === 'boolean') {
|
|
5069
|
-
if (isNumber(format)) {
|
|
5084
|
+
if (isNumber$1(format)) {
|
|
5070
5085
|
index = format;
|
|
5071
5086
|
format = undefined;
|
|
5072
5087
|
}
|
|
@@ -5077,7 +5092,7 @@
|
|
|
5077
5092
|
index = format;
|
|
5078
5093
|
localeSorted = false;
|
|
5079
5094
|
|
|
5080
|
-
if (isNumber(format)) {
|
|
5095
|
+
if (isNumber$1(format)) {
|
|
5081
5096
|
index = format;
|
|
5082
5097
|
format = undefined;
|
|
5083
5098
|
}
|
|
@@ -5620,7 +5635,7 @@
|
|
|
5620
5635
|
|
|
5621
5636
|
//! moment.js
|
|
5622
5637
|
|
|
5623
|
-
hooks.version = '2.29.
|
|
5638
|
+
hooks.version = '2.29.2';
|
|
5624
5639
|
|
|
5625
5640
|
setHookCallback(createLocal);
|
|
5626
5641
|
|
|
@@ -5665,6 +5680,13 @@
|
|
|
5665
5680
|
MONTH: 'YYYY-MM', // <input type="month" />
|
|
5666
5681
|
};
|
|
5667
5682
|
|
|
5683
|
+
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
5684
|
+
NodeType2["CONTAINER"] = "container";
|
|
5685
|
+
NodeType2["PAGE"] = "page";
|
|
5686
|
+
NodeType2["ROOT"] = "app";
|
|
5687
|
+
return NodeType2;
|
|
5688
|
+
})(NodeType || {});
|
|
5689
|
+
|
|
5668
5690
|
const sleep = (ms) => new Promise((resolve) => {
|
|
5669
5691
|
const timer = setTimeout(() => {
|
|
5670
5692
|
clearTimeout(timer);
|
|
@@ -5804,6 +5826,8 @@
|
|
|
5804
5826
|
return "";
|
|
5805
5827
|
};
|
|
5806
5828
|
const isPop = (node) => Boolean(node.type?.toLowerCase().endsWith("pop"));
|
|
5829
|
+
const isPage = (node) => Boolean(node.type?.toLowerCase() === NodeType.PAGE);
|
|
5830
|
+
const isNumber = (value) => /^(-?\d+)(\.\d+)?$/.test(value);
|
|
5807
5831
|
|
|
5808
5832
|
exports.asyncLoadCss = asyncLoadCss;
|
|
5809
5833
|
exports.asyncLoadJs = asyncLoadJs;
|
|
@@ -5812,13 +5836,14 @@
|
|
|
5812
5836
|
exports.filterXSS = filterXSS;
|
|
5813
5837
|
exports.getNodePath = getNodePath;
|
|
5814
5838
|
exports.getUrlParam = getUrlParam;
|
|
5839
|
+
exports.isNumber = isNumber;
|
|
5840
|
+
exports.isPage = isPage;
|
|
5815
5841
|
exports.isPop = isPop;
|
|
5816
5842
|
exports.sleep = sleep;
|
|
5817
5843
|
exports.toHump = toHump;
|
|
5818
5844
|
exports.toLine = toLine;
|
|
5819
5845
|
|
|
5820
|
-
Object.
|
|
5821
|
-
exports[Symbol.toStringTag] = 'Module';
|
|
5846
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
5822
5847
|
|
|
5823
5848
|
}));
|
|
5824
5849
|
//# sourceMappingURL=tmagic-utils.umd.js.map
|