mazey 3.8.4 → 3.9.0
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/README.md +0 -2
- package/lib/index.cjs.js +2 -2
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.esm.js +176 -79
- package/lib/mazey.min.js +2 -2
- package/package.json +1 -1
- package/scripts/build-helper.js +2 -0
package/lib/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* mazey v3.
|
|
2
|
+
* mazey v3.9.0
|
|
3
3
|
* (c) 2018-2023 Mazey Chu
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -72,15 +72,15 @@ var functionCall = functionBindNative ? call$2.bind(call$2) : function () {
|
|
|
72
72
|
|
|
73
73
|
var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
|
|
74
74
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
75
|
-
var getOwnPropertyDescriptor$
|
|
75
|
+
var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor;
|
|
76
76
|
|
|
77
77
|
// Nashorn ~ JDK8 bug
|
|
78
|
-
var NASHORN_BUG = getOwnPropertyDescriptor$
|
|
78
|
+
var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
|
|
79
79
|
|
|
80
80
|
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
81
81
|
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
82
82
|
var f$6 = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
83
|
-
var descriptor = getOwnPropertyDescriptor$
|
|
83
|
+
var descriptor = getOwnPropertyDescriptor$5(this, V);
|
|
84
84
|
return !!descriptor && descriptor.enumerable;
|
|
85
85
|
} : $propertyIsEnumerable$1;
|
|
86
86
|
|
|
@@ -108,10 +108,10 @@ var functionUncurryThis = functionBindNative ? uncurryThisWithBind : function (f
|
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
var toString$1 = functionUncurryThis({}.toString);
|
|
111
|
-
var stringSlice$
|
|
111
|
+
var stringSlice$9 = functionUncurryThis(''.slice);
|
|
112
112
|
|
|
113
113
|
var classofRaw = function (it) {
|
|
114
|
-
return stringSlice$
|
|
114
|
+
return stringSlice$9(toString$1(it), 8, -1);
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
var $Object$4 = Object;
|
|
@@ -672,22 +672,22 @@ var toIntegerOrInfinity = function (argument) {
|
|
|
672
672
|
};
|
|
673
673
|
|
|
674
674
|
var max$4 = Math.max;
|
|
675
|
-
var min$
|
|
675
|
+
var min$5 = Math.min;
|
|
676
676
|
|
|
677
677
|
// Helper for a popular repeating case of the spec:
|
|
678
678
|
// Let integer be ? ToInteger(index).
|
|
679
679
|
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
680
680
|
var toAbsoluteIndex = function (index, length) {
|
|
681
681
|
var integer = toIntegerOrInfinity(index);
|
|
682
|
-
return integer < 0 ? max$4(integer + length, 0) : min$
|
|
682
|
+
return integer < 0 ? max$4(integer + length, 0) : min$5(integer, length);
|
|
683
683
|
};
|
|
684
684
|
|
|
685
|
-
var min$
|
|
685
|
+
var min$4 = Math.min;
|
|
686
686
|
|
|
687
687
|
// `ToLength` abstract operation
|
|
688
688
|
// https://tc39.es/ecma262/#sec-tolength
|
|
689
689
|
var toLength = function (argument) {
|
|
690
|
-
return argument > 0 ? min$
|
|
690
|
+
return argument > 0 ? min$4(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
691
691
|
};
|
|
692
692
|
|
|
693
693
|
// `LengthOfArrayLike` abstract operation
|
|
@@ -815,7 +815,7 @@ var POLYFILL = isForced.POLYFILL = 'P';
|
|
|
815
815
|
|
|
816
816
|
var isForced_1 = isForced;
|
|
817
817
|
|
|
818
|
-
var getOwnPropertyDescriptor$
|
|
818
|
+
var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
|
|
819
819
|
|
|
820
820
|
|
|
821
821
|
|
|
@@ -852,7 +852,7 @@ var _export = function (options, source) {
|
|
|
852
852
|
if (target) for (key in source) {
|
|
853
853
|
sourceProperty = source[key];
|
|
854
854
|
if (options.dontCallGetSet) {
|
|
855
|
-
descriptor = getOwnPropertyDescriptor$
|
|
855
|
+
descriptor = getOwnPropertyDescriptor$4(target, key);
|
|
856
856
|
targetProperty = descriptor && descriptor.value;
|
|
857
857
|
} else targetProperty = target[key];
|
|
858
858
|
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
@@ -1400,7 +1400,7 @@ var exec$1 = functionUncurryThis(RegExpPrototype$2.exec);
|
|
|
1400
1400
|
var charAt$6 = functionUncurryThis(''.charAt);
|
|
1401
1401
|
var replace$3 = functionUncurryThis(''.replace);
|
|
1402
1402
|
var stringIndexOf$2 = functionUncurryThis(''.indexOf);
|
|
1403
|
-
var stringSlice$
|
|
1403
|
+
var stringSlice$8 = functionUncurryThis(''.slice);
|
|
1404
1404
|
// TODO: Use only proper RegExpIdentifierName
|
|
1405
1405
|
var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
|
|
1406
1406
|
var re1 = /a/g;
|
|
@@ -1465,7 +1465,7 @@ var handleNCG = function (string) {
|
|
|
1465
1465
|
brackets = true;
|
|
1466
1466
|
break;
|
|
1467
1467
|
case chr === '(':
|
|
1468
|
-
if (exec$1(IS_NCG, stringSlice$
|
|
1468
|
+
if (exec$1(IS_NCG, stringSlice$8(string, index + 1))) {
|
|
1469
1469
|
index += 2;
|
|
1470
1470
|
ncg = true;
|
|
1471
1471
|
}
|
|
@@ -1580,7 +1580,7 @@ var patchedExec = nativeExec;
|
|
|
1580
1580
|
var charAt$5 = functionUncurryThis(''.charAt);
|
|
1581
1581
|
var indexOf = functionUncurryThis(''.indexOf);
|
|
1582
1582
|
var replace$2 = functionUncurryThis(''.replace);
|
|
1583
|
-
var stringSlice$
|
|
1583
|
+
var stringSlice$7 = functionUncurryThis(''.slice);
|
|
1584
1584
|
|
|
1585
1585
|
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
1586
1586
|
var re1 = /a/;
|
|
@@ -1625,7 +1625,7 @@ if (PATCH) {
|
|
|
1625
1625
|
flags += 'g';
|
|
1626
1626
|
}
|
|
1627
1627
|
|
|
1628
|
-
strCopy = stringSlice$
|
|
1628
|
+
strCopy = stringSlice$7(str, re.lastIndex);
|
|
1629
1629
|
// Support anchored sticky behavior.
|
|
1630
1630
|
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$5(str, re.lastIndex - 1) !== '\n')) {
|
|
1631
1631
|
source = '(?: ' + source + ')';
|
|
@@ -1646,8 +1646,8 @@ if (PATCH) {
|
|
|
1646
1646
|
|
|
1647
1647
|
if (sticky) {
|
|
1648
1648
|
if (match) {
|
|
1649
|
-
match.input = stringSlice$
|
|
1650
|
-
match[0] = stringSlice$
|
|
1649
|
+
match.input = stringSlice$7(match.input, charsAdded);
|
|
1650
|
+
match[0] = stringSlice$7(match[0], charsAdded);
|
|
1651
1651
|
match.index = re.lastIndex;
|
|
1652
1652
|
re.lastIndex += match[0].length;
|
|
1653
1653
|
} else re.lastIndex = 0;
|
|
@@ -1684,7 +1684,7 @@ _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
|
|
|
1684
1684
|
exec: regexpExec
|
|
1685
1685
|
});
|
|
1686
1686
|
|
|
1687
|
-
var PROPER_FUNCTION_NAME$
|
|
1687
|
+
var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
|
|
1688
1688
|
|
|
1689
1689
|
|
|
1690
1690
|
|
|
@@ -1697,7 +1697,7 @@ var nativeToString = RegExpPrototype$1[TO_STRING];
|
|
|
1697
1697
|
|
|
1698
1698
|
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
|
1699
1699
|
// FF44- RegExp#toString has a wrong name
|
|
1700
|
-
var INCORRECT_NAME = PROPER_FUNCTION_NAME$
|
|
1700
|
+
var INCORRECT_NAME = PROPER_FUNCTION_NAME$2 && nativeToString.name != TO_STRING;
|
|
1701
1701
|
|
|
1702
1702
|
// `RegExp.prototype.toString` method
|
|
1703
1703
|
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
|
|
@@ -1793,7 +1793,7 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
|
|
|
1793
1793
|
|
|
1794
1794
|
var charAt$4 = functionUncurryThis(''.charAt);
|
|
1795
1795
|
var charCodeAt$1 = functionUncurryThis(''.charCodeAt);
|
|
1796
|
-
var stringSlice$
|
|
1796
|
+
var stringSlice$6 = functionUncurryThis(''.slice);
|
|
1797
1797
|
|
|
1798
1798
|
var createMethod$4 = function (CONVERT_TO_STRING) {
|
|
1799
1799
|
return function ($this, pos) {
|
|
@@ -1809,7 +1809,7 @@ var createMethod$4 = function (CONVERT_TO_STRING) {
|
|
|
1809
1809
|
? charAt$4(S, position)
|
|
1810
1810
|
: first
|
|
1811
1811
|
: CONVERT_TO_STRING
|
|
1812
|
-
? stringSlice$
|
|
1812
|
+
? stringSlice$6(S, position, position + 2)
|
|
1813
1813
|
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
1814
1814
|
};
|
|
1815
1815
|
};
|
|
@@ -1931,7 +1931,7 @@ var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBind
|
|
|
1931
1931
|
var floor$1 = Math.floor;
|
|
1932
1932
|
var charAt$2 = functionUncurryThis(''.charAt);
|
|
1933
1933
|
var replace$1 = functionUncurryThis(''.replace);
|
|
1934
|
-
var stringSlice$
|
|
1934
|
+
var stringSlice$5 = functionUncurryThis(''.slice);
|
|
1935
1935
|
// eslint-disable-next-line redos/no-vulnerable -- safe
|
|
1936
1936
|
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
|
1937
1937
|
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
|
@@ -1951,10 +1951,10 @@ var getSubstitution = function (matched, str, position, captures, namedCaptures,
|
|
|
1951
1951
|
switch (charAt$2(ch, 0)) {
|
|
1952
1952
|
case '$': return '$';
|
|
1953
1953
|
case '&': return matched;
|
|
1954
|
-
case '`': return stringSlice$
|
|
1955
|
-
case "'": return stringSlice$
|
|
1954
|
+
case '`': return stringSlice$5(str, 0, position);
|
|
1955
|
+
case "'": return stringSlice$5(str, tailPos);
|
|
1956
1956
|
case '<':
|
|
1957
|
-
capture = namedCaptures[stringSlice$
|
|
1957
|
+
capture = namedCaptures[stringSlice$5(ch, 1, -1)];
|
|
1958
1958
|
break;
|
|
1959
1959
|
default: // \d\d?
|
|
1960
1960
|
var n = +ch;
|
|
@@ -1973,11 +1973,11 @@ var getSubstitution = function (matched, str, position, captures, namedCaptures,
|
|
|
1973
1973
|
|
|
1974
1974
|
var REPLACE = wellKnownSymbol('replace');
|
|
1975
1975
|
var max$3 = Math.max;
|
|
1976
|
-
var min$
|
|
1976
|
+
var min$3 = Math.min;
|
|
1977
1977
|
var concat$1 = functionUncurryThis([].concat);
|
|
1978
1978
|
var push$3 = functionUncurryThis([].push);
|
|
1979
1979
|
var stringIndexOf$1 = functionUncurryThis(''.indexOf);
|
|
1980
|
-
var stringSlice$
|
|
1980
|
+
var stringSlice$4 = functionUncurryThis(''.slice);
|
|
1981
1981
|
|
|
1982
1982
|
var maybeToString = function (it) {
|
|
1983
1983
|
return it === undefined ? it : String(it);
|
|
@@ -2064,7 +2064,7 @@ fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
|
|
|
2064
2064
|
result = results[i];
|
|
2065
2065
|
|
|
2066
2066
|
var matched = toString_1(result[0]);
|
|
2067
|
-
var position = max$3(min$
|
|
2067
|
+
var position = max$3(min$3(toIntegerOrInfinity(result.index), S.length), 0);
|
|
2068
2068
|
var captures = [];
|
|
2069
2069
|
// NOTE: This is equivalent to
|
|
2070
2070
|
// captures = result.slice(1).map(maybeToString)
|
|
@@ -2081,11 +2081,11 @@ fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNa
|
|
|
2081
2081
|
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
|
2082
2082
|
}
|
|
2083
2083
|
if (position >= nextSourcePosition) {
|
|
2084
|
-
accumulatedResult += stringSlice$
|
|
2084
|
+
accumulatedResult += stringSlice$4(S, nextSourcePosition, position) + replacement;
|
|
2085
2085
|
nextSourcePosition = position + matched.length;
|
|
2086
2086
|
}
|
|
2087
2087
|
}
|
|
2088
|
-
return accumulatedResult + stringSlice$
|
|
2088
|
+
return accumulatedResult + stringSlice$4(S, nextSourcePosition);
|
|
2089
2089
|
}
|
|
2090
2090
|
];
|
|
2091
2091
|
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
@@ -2406,7 +2406,7 @@ var $RangeError = RangeError;
|
|
|
2406
2406
|
var $String = String;
|
|
2407
2407
|
var floor = Math.floor;
|
|
2408
2408
|
var repeat = functionUncurryThis(stringRepeat);
|
|
2409
|
-
var stringSlice$
|
|
2409
|
+
var stringSlice$3 = functionUncurryThis(''.slice);
|
|
2410
2410
|
var nativeToFixed = functionUncurryThis(1.0.toFixed);
|
|
2411
2411
|
|
|
2412
2412
|
var pow = function (x, n, acc) {
|
|
@@ -2519,7 +2519,7 @@ _export({ target: 'Number', proto: true, forced: FORCED$3 }, {
|
|
|
2519
2519
|
k = result.length;
|
|
2520
2520
|
result = sign + (k <= fractDigits
|
|
2521
2521
|
? '0.' + repeat('0', fractDigits - k) + result
|
|
2522
|
-
: stringSlice$
|
|
2522
|
+
: stringSlice$3(result, 0, k - fractDigits) + '.' + stringSlice$3(result, k - fractDigits));
|
|
2523
2523
|
} else {
|
|
2524
2524
|
result = sign + result;
|
|
2525
2525
|
} return result;
|
|
@@ -2614,11 +2614,11 @@ var arraySliceSimple = function (O, start, end) {
|
|
|
2614
2614
|
|
|
2615
2615
|
var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;
|
|
2616
2616
|
var MAX_UINT32 = 0xFFFFFFFF;
|
|
2617
|
-
var min$
|
|
2617
|
+
var min$2 = Math.min;
|
|
2618
2618
|
var $push = [].push;
|
|
2619
2619
|
var exec = functionUncurryThis(/./.exec);
|
|
2620
2620
|
var push = functionUncurryThis($push);
|
|
2621
|
-
var stringSlice$
|
|
2621
|
+
var stringSlice$2 = functionUncurryThis(''.slice);
|
|
2622
2622
|
|
|
2623
2623
|
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
|
2624
2624
|
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
|
@@ -2666,7 +2666,7 @@ fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa
|
|
|
2666
2666
|
while (match = functionCall(regexpExec, separatorCopy, string)) {
|
|
2667
2667
|
lastIndex = separatorCopy.lastIndex;
|
|
2668
2668
|
if (lastIndex > lastLastIndex) {
|
|
2669
|
-
push(output, stringSlice$
|
|
2669
|
+
push(output, stringSlice$2(string, lastLastIndex, match.index));
|
|
2670
2670
|
if (match.length > 1 && match.index < string.length) functionApply($push, output, arraySliceSimple(match, 1));
|
|
2671
2671
|
lastLength = match[0].length;
|
|
2672
2672
|
lastLastIndex = lastIndex;
|
|
@@ -2676,7 +2676,7 @@ fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa
|
|
|
2676
2676
|
}
|
|
2677
2677
|
if (lastLastIndex === string.length) {
|
|
2678
2678
|
if (lastLength || !exec(separatorCopy, '')) push(output, '');
|
|
2679
|
-
} else push(output, stringSlice$
|
|
2679
|
+
} else push(output, stringSlice$2(string, lastLastIndex));
|
|
2680
2680
|
return output.length > lim ? arraySliceSimple(output, 0, lim) : output;
|
|
2681
2681
|
};
|
|
2682
2682
|
// Chakra, V8
|
|
@@ -2727,15 +2727,15 @@ fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa
|
|
|
2727
2727
|
var A = [];
|
|
2728
2728
|
while (q < S.length) {
|
|
2729
2729
|
splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
|
|
2730
|
-
var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice$
|
|
2730
|
+
var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? stringSlice$2(S, q) : S);
|
|
2731
2731
|
var e;
|
|
2732
2732
|
if (
|
|
2733
2733
|
z === null ||
|
|
2734
|
-
(e = min$
|
|
2734
|
+
(e = min$2(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
|
|
2735
2735
|
) {
|
|
2736
2736
|
q = advanceStringIndex(S, q, unicodeMatching);
|
|
2737
2737
|
} else {
|
|
2738
|
-
push(A, stringSlice$
|
|
2738
|
+
push(A, stringSlice$2(S, p, q));
|
|
2739
2739
|
if (A.length === lim) return A;
|
|
2740
2740
|
for (var i = 1; i <= z.length - 1; i++) {
|
|
2741
2741
|
push(A, z[i]);
|
|
@@ -2744,7 +2744,7 @@ fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa
|
|
|
2744
2744
|
q = p = e;
|
|
2745
2745
|
}
|
|
2746
2746
|
}
|
|
2747
|
-
push(A, stringSlice$
|
|
2747
|
+
push(A, stringSlice$2(S, p));
|
|
2748
2748
|
return A;
|
|
2749
2749
|
}
|
|
2750
2750
|
];
|
|
@@ -2807,7 +2807,7 @@ _export({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== obje
|
|
|
2807
2807
|
var path = global_1;
|
|
2808
2808
|
|
|
2809
2809
|
var getOwnPropertyNames = objectGetOwnPropertyNames.f;
|
|
2810
|
-
var getOwnPropertyDescriptor$
|
|
2810
|
+
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
|
|
2811
2811
|
var defineProperty$1 = objectDefineProperty.f;
|
|
2812
2812
|
|
|
2813
2813
|
var trim = stringTrim.trim;
|
|
@@ -2817,7 +2817,7 @@ var NativeNumber = global_1[NUMBER];
|
|
|
2817
2817
|
path[NUMBER];
|
|
2818
2818
|
var NumberPrototype = NativeNumber.prototype;
|
|
2819
2819
|
var TypeError$2 = global_1.TypeError;
|
|
2820
|
-
var stringSlice = functionUncurryThis(''.slice);
|
|
2820
|
+
var stringSlice$1 = functionUncurryThis(''.slice);
|
|
2821
2821
|
var charCodeAt = functionUncurryThis(''.charCodeAt);
|
|
2822
2822
|
|
|
2823
2823
|
// `ToNumeric` abstract operation
|
|
@@ -2845,7 +2845,7 @@ var toNumber = function (argument) {
|
|
|
2845
2845
|
case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
|
|
2846
2846
|
default: return +it;
|
|
2847
2847
|
}
|
|
2848
|
-
digits = stringSlice(it, 2);
|
|
2848
|
+
digits = stringSlice$1(it, 2);
|
|
2849
2849
|
length = digits.length;
|
|
2850
2850
|
for (index = 0; index < length; index++) {
|
|
2851
2851
|
code = charCodeAt(digits, index);
|
|
@@ -2889,7 +2889,7 @@ var copyConstructorProperties = function (target, source) {
|
|
|
2889
2889
|
'fromString,range'
|
|
2890
2890
|
).split(','), j = 0, key; keys.length > j; j++) {
|
|
2891
2891
|
if (hasOwnProperty_1(source, key = keys[j]) && !hasOwnProperty_1(target, key)) {
|
|
2892
|
-
defineProperty$1(target, key, getOwnPropertyDescriptor$
|
|
2892
|
+
defineProperty$1(target, key, getOwnPropertyDescriptor$3(source, key));
|
|
2893
2893
|
}
|
|
2894
2894
|
}
|
|
2895
2895
|
};
|
|
@@ -3058,7 +3058,7 @@ var engineIsIosPebble = /ipad|iphone|ipod/i.test(engineUserAgent) && typeof Pebb
|
|
|
3058
3058
|
|
|
3059
3059
|
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(engineUserAgent);
|
|
3060
3060
|
|
|
3061
|
-
var getOwnPropertyDescriptor$
|
|
3061
|
+
var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
|
|
3062
3062
|
var macrotask = task$1.set;
|
|
3063
3063
|
|
|
3064
3064
|
|
|
@@ -3071,7 +3071,7 @@ var document$2 = global_1.document;
|
|
|
3071
3071
|
var process$2 = global_1.process;
|
|
3072
3072
|
var Promise$1 = global_1.Promise;
|
|
3073
3073
|
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
|
3074
|
-
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$
|
|
3074
|
+
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$2(global_1, 'queueMicrotask');
|
|
3075
3075
|
var microtask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
|
3076
3076
|
var notify$1, toggle, node, promise, then;
|
|
3077
3077
|
|
|
@@ -3785,6 +3785,89 @@ _export({ target: 'Array', proto: true, forced: FORCED }, {
|
|
|
3785
3785
|
}
|
|
3786
3786
|
});
|
|
3787
3787
|
|
|
3788
|
+
var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
|
|
3789
|
+
|
|
3790
|
+
|
|
3791
|
+
|
|
3792
|
+
var non = '\u200B\u0085\u180E';
|
|
3793
|
+
|
|
3794
|
+
// check that a method works with the correct list
|
|
3795
|
+
// of whitespaces and has a correct name
|
|
3796
|
+
var stringTrimForced = function (METHOD_NAME) {
|
|
3797
|
+
return fails(function () {
|
|
3798
|
+
return !!whitespaces[METHOD_NAME]()
|
|
3799
|
+
|| non[METHOD_NAME]() !== non
|
|
3800
|
+
|| (PROPER_FUNCTION_NAME$1 && whitespaces[METHOD_NAME].name !== METHOD_NAME);
|
|
3801
|
+
});
|
|
3802
|
+
};
|
|
3803
|
+
|
|
3804
|
+
var $trim = stringTrim.trim;
|
|
3805
|
+
|
|
3806
|
+
|
|
3807
|
+
// `String.prototype.trim` method
|
|
3808
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
3809
|
+
_export({ target: 'String', proto: true, forced: stringTrimForced('trim') }, {
|
|
3810
|
+
trim: function trim() {
|
|
3811
|
+
return $trim(this);
|
|
3812
|
+
}
|
|
3813
|
+
});
|
|
3814
|
+
|
|
3815
|
+
var $TypeError$2 = TypeError;
|
|
3816
|
+
|
|
3817
|
+
var notARegexp = function (it) {
|
|
3818
|
+
if (isRegexp(it)) {
|
|
3819
|
+
throw $TypeError$2("The method doesn't accept regular expressions");
|
|
3820
|
+
} return it;
|
|
3821
|
+
};
|
|
3822
|
+
|
|
3823
|
+
var MATCH = wellKnownSymbol('match');
|
|
3824
|
+
|
|
3825
|
+
var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
3826
|
+
var regexp = /./;
|
|
3827
|
+
try {
|
|
3828
|
+
'/./'[METHOD_NAME](regexp);
|
|
3829
|
+
} catch (error1) {
|
|
3830
|
+
try {
|
|
3831
|
+
regexp[MATCH] = false;
|
|
3832
|
+
return '/./'[METHOD_NAME](regexp);
|
|
3833
|
+
} catch (error2) { /* empty */ }
|
|
3834
|
+
} return false;
|
|
3835
|
+
};
|
|
3836
|
+
|
|
3837
|
+
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
3838
|
+
|
|
3839
|
+
|
|
3840
|
+
|
|
3841
|
+
|
|
3842
|
+
|
|
3843
|
+
|
|
3844
|
+
|
|
3845
|
+
// eslint-disable-next-line es/no-string-prototype-startswith -- safe
|
|
3846
|
+
var nativeStartsWith = functionUncurryThisClause(''.startsWith);
|
|
3847
|
+
var stringSlice = functionUncurryThisClause(''.slice);
|
|
3848
|
+
var min$1 = Math.min;
|
|
3849
|
+
|
|
3850
|
+
var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('startsWith');
|
|
3851
|
+
// https://github.com/zloirock/core-js/pull/702
|
|
3852
|
+
var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
|
3853
|
+
var descriptor = getOwnPropertyDescriptor$1(String.prototype, 'startsWith');
|
|
3854
|
+
return descriptor && !descriptor.writable;
|
|
3855
|
+
}();
|
|
3856
|
+
|
|
3857
|
+
// `String.prototype.startsWith` method
|
|
3858
|
+
// https://tc39.es/ecma262/#sec-string.prototype.startswith
|
|
3859
|
+
_export({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
|
3860
|
+
startsWith: function startsWith(searchString /* , position = 0 */) {
|
|
3861
|
+
var that = toString_1(requireObjectCoercible(this));
|
|
3862
|
+
notARegexp(searchString);
|
|
3863
|
+
var index = toLength(min$1(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
|
3864
|
+
var search = toString_1(searchString);
|
|
3865
|
+
return nativeStartsWith
|
|
3866
|
+
? nativeStartsWith(that, search, index)
|
|
3867
|
+
: stringSlice(that, index, index + search.length) === search;
|
|
3868
|
+
}
|
|
3869
|
+
});
|
|
3870
|
+
|
|
3788
3871
|
var $forEach = arrayIteration.forEach;
|
|
3789
3872
|
|
|
3790
3873
|
|
|
@@ -3908,28 +3991,6 @@ _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !corr
|
|
|
3908
3991
|
}
|
|
3909
3992
|
});
|
|
3910
3993
|
|
|
3911
|
-
var $TypeError$2 = TypeError;
|
|
3912
|
-
|
|
3913
|
-
var notARegexp = function (it) {
|
|
3914
|
-
if (isRegexp(it)) {
|
|
3915
|
-
throw $TypeError$2("The method doesn't accept regular expressions");
|
|
3916
|
-
} return it;
|
|
3917
|
-
};
|
|
3918
|
-
|
|
3919
|
-
var MATCH = wellKnownSymbol('match');
|
|
3920
|
-
|
|
3921
|
-
var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
3922
|
-
var regexp = /./;
|
|
3923
|
-
try {
|
|
3924
|
-
'/./'[METHOD_NAME](regexp);
|
|
3925
|
-
} catch (error1) {
|
|
3926
|
-
try {
|
|
3927
|
-
regexp[MATCH] = false;
|
|
3928
|
-
return '/./'[METHOD_NAME](regexp);
|
|
3929
|
-
} catch (error2) { /* empty */ }
|
|
3930
|
-
} return false;
|
|
3931
|
-
};
|
|
3932
|
-
|
|
3933
3994
|
var stringIndexOf = functionUncurryThis(''.indexOf);
|
|
3934
3995
|
|
|
3935
3996
|
// `String.prototype.includes` method
|
|
@@ -4460,7 +4521,7 @@ function calLongestCommonSubsequence(aStr, bStr) {
|
|
|
4460
4521
|
*/
|
|
4461
4522
|
function getQueryParam(param) {
|
|
4462
4523
|
var reg = new RegExp('(^|&)' + param + '=([^&]*)(&|$)');
|
|
4463
|
-
var r = location.search.
|
|
4524
|
+
var r = location.search.substring(1).match(reg);
|
|
4464
4525
|
if (r !== null) {
|
|
4465
4526
|
// return decodeURIComponent(unescape(r[2]));
|
|
4466
4527
|
return decodeURIComponent(r[2]);
|
|
@@ -4614,7 +4675,7 @@ function getDomain(url, rules) {
|
|
|
4614
4675
|
*/
|
|
4615
4676
|
function convertCamelToKebab(camelCase) {
|
|
4616
4677
|
var kebabCase = camelCase.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
4617
|
-
return kebabCase[0] === '-' ? kebabCase.
|
|
4678
|
+
return kebabCase[0] === '-' ? kebabCase.substring(1) : kebabCase;
|
|
4618
4679
|
}
|
|
4619
4680
|
/**
|
|
4620
4681
|
* Alias of `convertCamelToKebab`
|
|
@@ -4638,7 +4699,7 @@ function camelCaseToKebabCase(camelCase) {
|
|
|
4638
4699
|
*/
|
|
4639
4700
|
function convertCamelToUnder(camelCase) {
|
|
4640
4701
|
var kebabCase = camelCase.replace(/([A-Z])/g, '_$1').toLowerCase();
|
|
4641
|
-
return kebabCase[0] === '_' ? kebabCase.
|
|
4702
|
+
return kebabCase[0] === '_' ? kebabCase.substring(1) : kebabCase;
|
|
4642
4703
|
}
|
|
4643
4704
|
/**
|
|
4644
4705
|
* Alias of `convertCamelToUnder`
|
|
@@ -5668,13 +5729,20 @@ function getCookie(name) {
|
|
|
5668
5729
|
* @category Cache Data
|
|
5669
5730
|
*/
|
|
5670
5731
|
function delCookie(name) {
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5732
|
+
var cookies = document.cookie.split(';');
|
|
5733
|
+
for (var i = 0; i < cookies.length; i++) {
|
|
5734
|
+
var cookie = cookies[i].trim();
|
|
5735
|
+
if (cookie.startsWith("".concat(name, "="))) {
|
|
5736
|
+
var cookieParts = cookie.split('=');
|
|
5737
|
+
var cookieName = cookieParts[0];
|
|
5738
|
+
// const cookieValue = cookieParts[1];
|
|
5739
|
+
var expires = new Date();
|
|
5740
|
+
expires.setTime(expires.getTime() - 1);
|
|
5741
|
+
document.cookie = "".concat(cookieName, "=;expires=").concat(expires.toUTCString());
|
|
5742
|
+
return true;
|
|
5743
|
+
}
|
|
5677
5744
|
}
|
|
5745
|
+
return false;
|
|
5678
5746
|
}
|
|
5679
5747
|
/**
|
|
5680
5748
|
* EN: Get page load time(PerformanceTiming).
|
|
@@ -7281,5 +7349,34 @@ function loadScriptIfUndefined(windowAttribute, url) {
|
|
|
7281
7349
|
}
|
|
7282
7350
|
return loadScript(url);
|
|
7283
7351
|
}
|
|
7352
|
+
/**
|
|
7353
|
+
* Retrieve a query parameter from a script URL in the browser.
|
|
7354
|
+
*
|
|
7355
|
+
* @param param - The name of the query parameter to retrieve.
|
|
7356
|
+
* @param matchString - An optional substring to match in the script URL.
|
|
7357
|
+
* If not provided, defaults to matching the ".js" substring.
|
|
7358
|
+
* @returns The decoded value of the specified query parameter, or an empty string if no matching parameter is found.
|
|
7359
|
+
* @category URL
|
|
7360
|
+
*/
|
|
7361
|
+
function getScriptQueryParam(param, matchString) {
|
|
7362
|
+
if (matchString === void 0) {
|
|
7363
|
+
matchString = '';
|
|
7364
|
+
}
|
|
7365
|
+
if (!matchString) {
|
|
7366
|
+
matchString = '.js';
|
|
7367
|
+
}
|
|
7368
|
+
var paramRegExp = new RegExp("[?&]".concat(param, "=([^&]*)"));
|
|
7369
|
+
var scriptTags = document.querySelectorAll("script[src*=\"".concat(matchString, "\"]"));
|
|
7370
|
+
for (var i = 0; i < scriptTags.length; i++) {
|
|
7371
|
+
var src = scriptTags[i].getAttribute('src');
|
|
7372
|
+
if (src && src.indexOf(matchString) !== -1) {
|
|
7373
|
+
var match = src.match(paramRegExp);
|
|
7374
|
+
if (match) {
|
|
7375
|
+
return decodeURIComponent(match[1]);
|
|
7376
|
+
}
|
|
7377
|
+
}
|
|
7378
|
+
}
|
|
7379
|
+
return '';
|
|
7380
|
+
}
|
|
7284
7381
|
|
|
7285
|
-
export { addClass, addEvent, addStyle, calLongestCommonSubsequence, calLongestCommonSubstring, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHtml, convert10To26, convertCamelToKebab, convertCamelToUnder, cutCHSString, debounce, deepCopy, deepCopyObject, delCookie, doFn, floatFixed, floatToPercent, formatDate, genCustomConsole, genHashCode, genRndNumString, genStyleString, genUniqueNumString, generateRndNum, generateUniqueNum, getBrowserInfo, getCookie, getCurrentVersion, getDefineListeners, getDomain, getFileSize, getFriendlyInterval, getHashQueryParam, getLocalStorage, getPerformance, getQueryParam, getSessionStorage, getUrlFileType, getUrlParam, hasClass, inRate, invokeEvent, isJSONString, isJsonString, isNonEmptyArray, isNumber, isSafePWAEnv, isSupportWebp, isValidData, isValidEmail, isValidPhoneNumber, isValidUrl, loadCSS, loadImage, loadScript, loadScriptIfUndefined, longestComSubsequence, longestComSubstring, mNow, mTrim, newLine, removeClass, removeEvent, repeatUntilConditionMet, sanitizeInput, setCookie, setImgWidHeiBySrc, setLocalStorage, setSessionStorage, throttle, truncateZHString, unsanitize, updateQueryParam, windowLoaded, zAxiosIsValidRes };
|
|
7382
|
+
export { addClass, addEvent, addStyle, calLongestCommonSubsequence, calLongestCommonSubstring, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHtml, convert10To26, convertCamelToKebab, convertCamelToUnder, cutCHSString, debounce, deepCopy, deepCopyObject, delCookie, doFn, floatFixed, floatToPercent, formatDate, genCustomConsole, genHashCode, genRndNumString, genStyleString, genUniqueNumString, generateRndNum, generateUniqueNum, getBrowserInfo, getCookie, getCurrentVersion, getDefineListeners, getDomain, getFileSize, getFriendlyInterval, getHashQueryParam, getLocalStorage, getPerformance, getQueryParam, getScriptQueryParam, getSessionStorage, getUrlFileType, getUrlParam, hasClass, inRate, invokeEvent, isJSONString, isJsonString, isNonEmptyArray, isNumber, isSafePWAEnv, isSupportWebp, isValidData, isValidEmail, isValidPhoneNumber, isValidUrl, loadCSS, loadImage, loadScript, loadScriptIfUndefined, longestComSubsequence, longestComSubstring, mNow, mTrim, newLine, removeClass, removeEvent, repeatUntilConditionMet, sanitizeInput, setCookie, setImgWidHeiBySrc, setLocalStorage, setSessionStorage, throttle, truncateZHString, unsanitize, updateQueryParam, windowLoaded, zAxiosIsValidRes };
|