@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.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//! moment.js
|
|
2
|
-
//! version : 2.29.
|
|
2
|
+
//! version : 2.29.2
|
|
3
3
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
4
4
|
//! license : MIT
|
|
5
5
|
//! momentjs.com
|
|
@@ -54,7 +54,7 @@ function isUndefined(input) {
|
|
|
54
54
|
return input === void 0;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
function isNumber(input) {
|
|
57
|
+
function isNumber$1(input) {
|
|
58
58
|
return (
|
|
59
59
|
typeof input === 'number' ||
|
|
60
60
|
Object.prototype.toString.call(input) === '[object Number]'
|
|
@@ -70,8 +70,9 @@ function isDate(input) {
|
|
|
70
70
|
|
|
71
71
|
function map(arr, fn) {
|
|
72
72
|
var res = [],
|
|
73
|
-
i
|
|
74
|
-
|
|
73
|
+
i,
|
|
74
|
+
arrLen = arr.length;
|
|
75
|
+
for (i = 0; i < arrLen; ++i) {
|
|
75
76
|
res.push(fn(arr[i], i));
|
|
76
77
|
}
|
|
77
78
|
return res;
|
|
@@ -200,7 +201,10 @@ var momentProperties = (hooks.momentProperties = []),
|
|
|
200
201
|
updateInProgress = false;
|
|
201
202
|
|
|
202
203
|
function copyConfig(to, from) {
|
|
203
|
-
var i,
|
|
204
|
+
var i,
|
|
205
|
+
prop,
|
|
206
|
+
val,
|
|
207
|
+
momentPropertiesLen = momentProperties.length;
|
|
204
208
|
|
|
205
209
|
if (!isUndefined(from._isAMomentObject)) {
|
|
206
210
|
to._isAMomentObject = from._isAMomentObject;
|
|
@@ -233,8 +237,8 @@ function copyConfig(to, from) {
|
|
|
233
237
|
to._locale = from._locale;
|
|
234
238
|
}
|
|
235
239
|
|
|
236
|
-
if (
|
|
237
|
-
for (i = 0; i <
|
|
240
|
+
if (momentPropertiesLen > 0) {
|
|
241
|
+
for (i = 0; i < momentPropertiesLen; i++) {
|
|
238
242
|
prop = momentProperties[i];
|
|
239
243
|
val = from[prop];
|
|
240
244
|
if (!isUndefined(val)) {
|
|
@@ -289,8 +293,9 @@ function deprecate(msg, fn) {
|
|
|
289
293
|
var args = [],
|
|
290
294
|
arg,
|
|
291
295
|
i,
|
|
292
|
-
key
|
|
293
|
-
|
|
296
|
+
key,
|
|
297
|
+
argLen = arguments.length;
|
|
298
|
+
for (i = 0; i < argLen; i++) {
|
|
294
299
|
arg = '';
|
|
295
300
|
if (typeof arguments[i] === 'object') {
|
|
296
301
|
arg += '\n[' + i + '] ';
|
|
@@ -440,7 +445,8 @@ function zeroFill(number, targetLength, forceSign) {
|
|
|
440
445
|
);
|
|
441
446
|
}
|
|
442
447
|
|
|
443
|
-
var formattingTokens =
|
|
448
|
+
var formattingTokens =
|
|
449
|
+
/(\[[^\[]*\])|(\\)?([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,
|
|
444
450
|
localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
|
|
445
451
|
formatFunctions = {},
|
|
446
452
|
formatTokenFunctions = {};
|
|
@@ -744,8 +750,9 @@ function stringSet(units, value) {
|
|
|
744
750
|
if (typeof units === 'object') {
|
|
745
751
|
units = normalizeObjectUnits(units);
|
|
746
752
|
var prioritized = getPrioritizedUnits(units),
|
|
747
|
-
i
|
|
748
|
-
|
|
753
|
+
i,
|
|
754
|
+
prioritizedLen = prioritized.length;
|
|
755
|
+
for (i = 0; i < prioritizedLen; i++) {
|
|
749
756
|
this[prioritized[i].unit](units[prioritized[i].unit]);
|
|
750
757
|
}
|
|
751
758
|
} else {
|
|
@@ -775,7 +782,8 @@ var match1 = /\d/, // 0 - 9
|
|
|
775
782
|
matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
|
|
776
783
|
// any word (or two) characters or numbers including two/three word month in arabic.
|
|
777
784
|
// includes scottish gaelic two word and hyphenated months
|
|
778
|
-
matchWord =
|
|
785
|
+
matchWord =
|
|
786
|
+
/[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,
|
|
779
787
|
regexes;
|
|
780
788
|
|
|
781
789
|
regexes = {};
|
|
@@ -801,15 +809,12 @@ function unescapeFormat(s) {
|
|
|
801
809
|
return regexEscape(
|
|
802
810
|
s
|
|
803
811
|
.replace('\\', '')
|
|
804
|
-
.replace(
|
|
805
|
-
|
|
806
|
-
p1,
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
) {
|
|
811
|
-
return p1 || p2 || p3 || p4;
|
|
812
|
-
})
|
|
812
|
+
.replace(
|
|
813
|
+
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
|
814
|
+
function (matched, p1, p2, p3, p4) {
|
|
815
|
+
return p1 || p2 || p3 || p4;
|
|
816
|
+
}
|
|
817
|
+
)
|
|
813
818
|
);
|
|
814
819
|
}
|
|
815
820
|
|
|
@@ -821,16 +826,18 @@ var tokens = {};
|
|
|
821
826
|
|
|
822
827
|
function addParseToken(token, callback) {
|
|
823
828
|
var i,
|
|
824
|
-
func = callback
|
|
829
|
+
func = callback,
|
|
830
|
+
tokenLen;
|
|
825
831
|
if (typeof token === 'string') {
|
|
826
832
|
token = [token];
|
|
827
833
|
}
|
|
828
|
-
if (isNumber(callback)) {
|
|
834
|
+
if (isNumber$1(callback)) {
|
|
829
835
|
func = function (input, array) {
|
|
830
836
|
array[callback] = toInt(input);
|
|
831
837
|
};
|
|
832
838
|
}
|
|
833
|
-
|
|
839
|
+
tokenLen = token.length;
|
|
840
|
+
for (i = 0; i < tokenLen; i++) {
|
|
834
841
|
tokens[token[i]] = func;
|
|
835
842
|
}
|
|
836
843
|
}
|
|
@@ -941,12 +948,12 @@ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
|
|
|
941
948
|
|
|
942
949
|
// LOCALES
|
|
943
950
|
|
|
944
|
-
var defaultLocaleMonths =
|
|
945
|
-
'
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
951
|
+
var defaultLocaleMonths =
|
|
952
|
+
'January_February_March_April_May_June_July_August_September_October_November_December'.split(
|
|
953
|
+
'_'
|
|
954
|
+
),
|
|
955
|
+
defaultLocaleMonthsShort =
|
|
956
|
+
'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
|
|
950
957
|
MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
|
|
951
958
|
defaultMonthsShortRegex = matchWord,
|
|
952
959
|
defaultMonthsRegex = matchWord;
|
|
@@ -1095,7 +1102,7 @@ function setMonth(mom, value) {
|
|
|
1095
1102
|
} else {
|
|
1096
1103
|
value = mom.localeData().monthsParse(value);
|
|
1097
1104
|
// TODO: Another silent failure?
|
|
1098
|
-
if (!isNumber(value)) {
|
|
1105
|
+
if (!isNumber$1(value)) {
|
|
1099
1106
|
return mom;
|
|
1100
1107
|
}
|
|
1101
1108
|
}
|
|
@@ -1388,14 +1395,12 @@ addRegexToken('ww', match1to2, match2);
|
|
|
1388
1395
|
addRegexToken('W', match1to2);
|
|
1389
1396
|
addRegexToken('WW', match1to2, match2);
|
|
1390
1397
|
|
|
1391
|
-
addWeekParseToken(
|
|
1392
|
-
|
|
1393
|
-
week,
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
)
|
|
1397
|
-
week[token.substr(0, 1)] = toInt(input);
|
|
1398
|
-
});
|
|
1398
|
+
addWeekParseToken(
|
|
1399
|
+
['w', 'ww', 'W', 'WW'],
|
|
1400
|
+
function (input, week, config, token) {
|
|
1401
|
+
week[token.substr(0, 1)] = toInt(input);
|
|
1402
|
+
}
|
|
1403
|
+
);
|
|
1399
1404
|
|
|
1400
1405
|
// HELPERS
|
|
1401
1406
|
|
|
@@ -1520,9 +1525,8 @@ function shiftWeekdays(ws, n) {
|
|
|
1520
1525
|
return ws.slice(n, 7).concat(ws.slice(0, n));
|
|
1521
1526
|
}
|
|
1522
1527
|
|
|
1523
|
-
var defaultLocaleWeekdays =
|
|
1524
|
-
'_'
|
|
1525
|
-
),
|
|
1528
|
+
var defaultLocaleWeekdays =
|
|
1529
|
+
'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
|
|
1526
1530
|
defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
|
|
1527
1531
|
defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
|
|
1528
1532
|
defaultWeekdaysRegex = matchWord,
|
|
@@ -2070,6 +2074,11 @@ function chooseLocale(names) {
|
|
|
2070
2074
|
return globalLocale;
|
|
2071
2075
|
}
|
|
2072
2076
|
|
|
2077
|
+
function isLocaleNameSane(name) {
|
|
2078
|
+
// Prevent names that look like filesystem paths, i.e contain '/' or '\'
|
|
2079
|
+
return name.match('^[^/\\\\]*$') != null;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2073
2082
|
function loadLocale(name) {
|
|
2074
2083
|
var oldLocale = null,
|
|
2075
2084
|
aliasedRequire;
|
|
@@ -2078,7 +2087,8 @@ function loadLocale(name) {
|
|
|
2078
2087
|
locales[name] === undefined &&
|
|
2079
2088
|
typeof module !== 'undefined' &&
|
|
2080
2089
|
module &&
|
|
2081
|
-
module.exports
|
|
2090
|
+
module.exports &&
|
|
2091
|
+
isLocaleNameSane(name)
|
|
2082
2092
|
) {
|
|
2083
2093
|
try {
|
|
2084
2094
|
oldLocale = globalLocale._abbr;
|
|
@@ -2295,8 +2305,10 @@ function checkOverflow(m) {
|
|
|
2295
2305
|
|
|
2296
2306
|
// iso 8601 regex
|
|
2297
2307
|
// 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)
|
|
2298
|
-
var extendedIsoRegex =
|
|
2299
|
-
|
|
2308
|
+
var extendedIsoRegex =
|
|
2309
|
+
/^\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)?)?$/,
|
|
2310
|
+
basicIsoRegex =
|
|
2311
|
+
/^\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)?)?$/,
|
|
2300
2312
|
tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
|
|
2301
2313
|
isoDates = [
|
|
2302
2314
|
['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
|
|
@@ -2327,7 +2339,8 @@ var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\
|
|
|
2327
2339
|
],
|
|
2328
2340
|
aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
|
|
2329
2341
|
// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
|
|
2330
|
-
rfc2822 =
|
|
2342
|
+
rfc2822 =
|
|
2343
|
+
/^(?:(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}))$/,
|
|
2331
2344
|
obsOffsets = {
|
|
2332
2345
|
UT: 0,
|
|
2333
2346
|
GMT: 0,
|
|
@@ -2350,12 +2363,13 @@ function configFromISO(config) {
|
|
|
2350
2363
|
allowTime,
|
|
2351
2364
|
dateFormat,
|
|
2352
2365
|
timeFormat,
|
|
2353
|
-
tzFormat
|
|
2366
|
+
tzFormat,
|
|
2367
|
+
isoDatesLen = isoDates.length,
|
|
2368
|
+
isoTimesLen = isoTimes.length;
|
|
2354
2369
|
|
|
2355
2370
|
if (match) {
|
|
2356
2371
|
getParsingFlags(config).iso = true;
|
|
2357
|
-
|
|
2358
|
-
for (i = 0, l = isoDates.length; i < l; i++) {
|
|
2372
|
+
for (i = 0, l = isoDatesLen; i < l; i++) {
|
|
2359
2373
|
if (isoDates[i][1].exec(match[1])) {
|
|
2360
2374
|
dateFormat = isoDates[i][0];
|
|
2361
2375
|
allowTime = isoDates[i][2] !== false;
|
|
@@ -2367,7 +2381,7 @@ function configFromISO(config) {
|
|
|
2367
2381
|
return;
|
|
2368
2382
|
}
|
|
2369
2383
|
if (match[3]) {
|
|
2370
|
-
for (i = 0, l =
|
|
2384
|
+
for (i = 0, l = isoTimesLen; i < l; i++) {
|
|
2371
2385
|
if (isoTimes[i][1].exec(match[3])) {
|
|
2372
2386
|
// match[2] should be 'T' or space
|
|
2373
2387
|
timeFormat = (match[2] || ' ') + isoTimes[i][0];
|
|
@@ -2747,12 +2761,13 @@ function configFromStringAndFormat(config) {
|
|
|
2747
2761
|
skipped,
|
|
2748
2762
|
stringLength = string.length,
|
|
2749
2763
|
totalParsedInputLength = 0,
|
|
2750
|
-
era
|
|
2764
|
+
era,
|
|
2765
|
+
tokenLen;
|
|
2751
2766
|
|
|
2752
2767
|
tokens =
|
|
2753
2768
|
expandFormat(config._f, config._locale).match(formattingTokens) || [];
|
|
2754
|
-
|
|
2755
|
-
for (i = 0; i <
|
|
2769
|
+
tokenLen = tokens.length;
|
|
2770
|
+
for (i = 0; i < tokenLen; i++) {
|
|
2756
2771
|
token = tokens[i];
|
|
2757
2772
|
parsedInput = (string.match(getParseRegexForToken(token, config)) ||
|
|
2758
2773
|
[])[0];
|
|
@@ -2847,15 +2862,16 @@ function configFromStringAndArray(config) {
|
|
|
2847
2862
|
i,
|
|
2848
2863
|
currentScore,
|
|
2849
2864
|
validFormatFound,
|
|
2850
|
-
bestFormatIsValid = false
|
|
2865
|
+
bestFormatIsValid = false,
|
|
2866
|
+
configfLen = config._f.length;
|
|
2851
2867
|
|
|
2852
|
-
if (
|
|
2868
|
+
if (configfLen === 0) {
|
|
2853
2869
|
getParsingFlags(config).invalidFormat = true;
|
|
2854
2870
|
config._d = new Date(NaN);
|
|
2855
2871
|
return;
|
|
2856
2872
|
}
|
|
2857
2873
|
|
|
2858
|
-
for (i = 0; i <
|
|
2874
|
+
for (i = 0; i < configfLen; i++) {
|
|
2859
2875
|
currentScore = 0;
|
|
2860
2876
|
validFormatFound = false;
|
|
2861
2877
|
tempConfig = copyConfig({}, config);
|
|
@@ -2976,7 +2992,7 @@ function configFromInput(config) {
|
|
|
2976
2992
|
configFromArray(config);
|
|
2977
2993
|
} else if (isObject(input)) {
|
|
2978
2994
|
configFromObject(config);
|
|
2979
|
-
} else if (isNumber(input)) {
|
|
2995
|
+
} else if (isNumber$1(input)) {
|
|
2980
2996
|
// from milliseconds
|
|
2981
2997
|
config._d = new Date(input);
|
|
2982
2998
|
} else {
|
|
@@ -3096,7 +3112,8 @@ var ordering = [
|
|
|
3096
3112
|
function isDurationValid(m) {
|
|
3097
3113
|
var key,
|
|
3098
3114
|
unitHasDecimal = false,
|
|
3099
|
-
i
|
|
3115
|
+
i,
|
|
3116
|
+
orderLen = ordering.length;
|
|
3100
3117
|
for (key in m) {
|
|
3101
3118
|
if (
|
|
3102
3119
|
hasOwnProp(m, key) &&
|
|
@@ -3109,7 +3126,7 @@ function isDurationValid(m) {
|
|
|
3109
3126
|
}
|
|
3110
3127
|
}
|
|
3111
3128
|
|
|
3112
|
-
for (i = 0; i <
|
|
3129
|
+
for (i = 0; i < orderLen; ++i) {
|
|
3113
3130
|
if (m[ordering[i]]) {
|
|
3114
3131
|
if (unitHasDecimal) {
|
|
3115
3132
|
return false; // only allow non-integers for smallest unit
|
|
@@ -3434,7 +3451,8 @@ var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
|
|
|
3434
3451
|
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
|
|
3435
3452
|
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
|
|
3436
3453
|
// and further modified to allow for strings containing both week and day
|
|
3437
|
-
isoRegex =
|
|
3454
|
+
isoRegex =
|
|
3455
|
+
/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
|
|
3438
3456
|
|
|
3439
3457
|
function createDuration(input, key) {
|
|
3440
3458
|
var duration = input,
|
|
@@ -3450,7 +3468,7 @@ function createDuration(input, key) {
|
|
|
3450
3468
|
d: input._days,
|
|
3451
3469
|
M: input._months,
|
|
3452
3470
|
};
|
|
3453
|
-
} else if (isNumber(input) || !isNaN(+input)) {
|
|
3471
|
+
} else if (isNumber$1(input) || !isNaN(+input)) {
|
|
3454
3472
|
duration = {};
|
|
3455
3473
|
if (key) {
|
|
3456
3474
|
duration[key] = +input;
|
|
@@ -3617,7 +3635,7 @@ function isMomentInput(input) {
|
|
|
3617
3635
|
isMoment(input) ||
|
|
3618
3636
|
isDate(input) ||
|
|
3619
3637
|
isString(input) ||
|
|
3620
|
-
isNumber(input) ||
|
|
3638
|
+
isNumber$1(input) ||
|
|
3621
3639
|
isNumberOrStringArray(input) ||
|
|
3622
3640
|
isMomentInputObject(input) ||
|
|
3623
3641
|
input === null ||
|
|
@@ -3655,9 +3673,10 @@ function isMomentInputObject(input) {
|
|
|
3655
3673
|
'ms',
|
|
3656
3674
|
],
|
|
3657
3675
|
i,
|
|
3658
|
-
property
|
|
3676
|
+
property,
|
|
3677
|
+
propertyLen = properties.length;
|
|
3659
3678
|
|
|
3660
|
-
for (i = 0; i <
|
|
3679
|
+
for (i = 0; i < propertyLen; i += 1) {
|
|
3661
3680
|
property = properties[i];
|
|
3662
3681
|
propertyTest = propertyTest || hasOwnProp(input, property);
|
|
3663
3682
|
}
|
|
@@ -3671,7 +3690,7 @@ function isNumberOrStringArray(input) {
|
|
|
3671
3690
|
if (arrayTest) {
|
|
3672
3691
|
dataTypeTest =
|
|
3673
3692
|
input.filter(function (item) {
|
|
3674
|
-
return !isNumber(item) && isString(input);
|
|
3693
|
+
return !isNumber$1(item) && isString(input);
|
|
3675
3694
|
}).length === 0;
|
|
3676
3695
|
}
|
|
3677
3696
|
return arrayTest && dataTypeTest;
|
|
@@ -4280,19 +4299,17 @@ addRegexToken('NNN', matchEraAbbr);
|
|
|
4280
4299
|
addRegexToken('NNNN', matchEraName);
|
|
4281
4300
|
addRegexToken('NNNNN', matchEraNarrow);
|
|
4282
4301
|
|
|
4283
|
-
addParseToken(
|
|
4284
|
-
|
|
4285
|
-
array,
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
)
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
} else {
|
|
4293
|
-
getParsingFlags(config).invalidEra = input;
|
|
4302
|
+
addParseToken(
|
|
4303
|
+
['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
|
|
4304
|
+
function (input, array, config, token) {
|
|
4305
|
+
var era = config._locale.erasParse(input, token, config._strict);
|
|
4306
|
+
if (era) {
|
|
4307
|
+
getParsingFlags(config).era = era;
|
|
4308
|
+
} else {
|
|
4309
|
+
getParsingFlags(config).invalidEra = input;
|
|
4310
|
+
}
|
|
4294
4311
|
}
|
|
4295
|
-
|
|
4312
|
+
);
|
|
4296
4313
|
|
|
4297
4314
|
addRegexToken('y', matchUnsigned);
|
|
4298
4315
|
addRegexToken('yy', matchUnsigned);
|
|
@@ -4584,14 +4601,12 @@ addRegexToken('gggg', match1to4, match4);
|
|
|
4584
4601
|
addRegexToken('GGGGG', match1to6, match6);
|
|
4585
4602
|
addRegexToken('ggggg', match1to6, match6);
|
|
4586
4603
|
|
|
4587
|
-
addWeekParseToken(
|
|
4588
|
-
|
|
4589
|
-
week,
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
)
|
|
4593
|
-
week[token.substr(0, 2)] = toInt(input);
|
|
4594
|
-
});
|
|
4604
|
+
addWeekParseToken(
|
|
4605
|
+
['gggg', 'ggggg', 'GGGG', 'GGGGG'],
|
|
4606
|
+
function (input, week, config, token) {
|
|
4607
|
+
week[token.substr(0, 2)] = toInt(input);
|
|
4608
|
+
}
|
|
4609
|
+
);
|
|
4595
4610
|
|
|
4596
4611
|
addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
|
|
4597
4612
|
week[token] = hooks.parseTwoDigitYear(input);
|
|
@@ -5031,7 +5046,7 @@ function get$1(format, index, field, setter) {
|
|
|
5031
5046
|
}
|
|
5032
5047
|
|
|
5033
5048
|
function listMonthsImpl(format, index, field) {
|
|
5034
|
-
if (isNumber(format)) {
|
|
5049
|
+
if (isNumber$1(format)) {
|
|
5035
5050
|
index = format;
|
|
5036
5051
|
format = undefined;
|
|
5037
5052
|
}
|
|
@@ -5060,7 +5075,7 @@ function listMonthsImpl(format, index, field) {
|
|
|
5060
5075
|
// (true, fmt)
|
|
5061
5076
|
function listWeekdaysImpl(localeSorted, format, index, field) {
|
|
5062
5077
|
if (typeof localeSorted === 'boolean') {
|
|
5063
|
-
if (isNumber(format)) {
|
|
5078
|
+
if (isNumber$1(format)) {
|
|
5064
5079
|
index = format;
|
|
5065
5080
|
format = undefined;
|
|
5066
5081
|
}
|
|
@@ -5071,7 +5086,7 @@ function listWeekdaysImpl(localeSorted, format, index, field) {
|
|
|
5071
5086
|
index = format;
|
|
5072
5087
|
localeSorted = false;
|
|
5073
5088
|
|
|
5074
|
-
if (isNumber(format)) {
|
|
5089
|
+
if (isNumber$1(format)) {
|
|
5075
5090
|
index = format;
|
|
5076
5091
|
format = undefined;
|
|
5077
5092
|
}
|
|
@@ -5614,7 +5629,7 @@ addParseToken('x', function (input, array, config) {
|
|
|
5614
5629
|
|
|
5615
5630
|
//! moment.js
|
|
5616
5631
|
|
|
5617
|
-
hooks.version = '2.29.
|
|
5632
|
+
hooks.version = '2.29.2';
|
|
5618
5633
|
|
|
5619
5634
|
setHookCallback(createLocal);
|
|
5620
5635
|
|
|
@@ -5659,6 +5674,13 @@ hooks.HTML5_FMT = {
|
|
|
5659
5674
|
MONTH: 'YYYY-MM', // <input type="month" />
|
|
5660
5675
|
};
|
|
5661
5676
|
|
|
5677
|
+
var NodeType = /* @__PURE__ */ ((NodeType2) => {
|
|
5678
|
+
NodeType2["CONTAINER"] = "container";
|
|
5679
|
+
NodeType2["PAGE"] = "page";
|
|
5680
|
+
NodeType2["ROOT"] = "app";
|
|
5681
|
+
return NodeType2;
|
|
5682
|
+
})(NodeType || {});
|
|
5683
|
+
|
|
5662
5684
|
const sleep = (ms) => new Promise((resolve) => {
|
|
5663
5685
|
const timer = setTimeout(() => {
|
|
5664
5686
|
clearTimeout(timer);
|
|
@@ -5798,6 +5820,8 @@ const getUrlParam = (param, url) => {
|
|
|
5798
5820
|
return "";
|
|
5799
5821
|
};
|
|
5800
5822
|
const isPop = (node) => Boolean(node.type?.toLowerCase().endsWith("pop"));
|
|
5823
|
+
const isPage = (node) => Boolean(node.type?.toLowerCase() === NodeType.PAGE);
|
|
5824
|
+
const isNumber = (value) => /^(-?\d+)(\.\d+)?$/.test(value);
|
|
5801
5825
|
|
|
5802
|
-
export { asyncLoadCss, asyncLoadJs, datetimeFormatter, emptyFn, filterXSS, getNodePath, getUrlParam, isPop, sleep, toHump, toLine };
|
|
5826
|
+
export { asyncLoadCss, asyncLoadJs, datetimeFormatter, emptyFn, filterXSS, getNodePath, getUrlParam, isNumber, isPage, isPop, sleep, toHump, toLine };
|
|
5803
5827
|
//# sourceMappingURL=tmagic-utils.es.js.map
|