mazey 3.8.0 → 3.8.1
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 +16 -52
- package/lib/index.cjs.js +2 -7189
- package/lib/index.d.ts +35 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.esm.js +256 -143
- package/lib/mazey.min.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,14 +71,13 @@ There ara some examples maintained by hand below. For more information, please c
|
|
|
71
71
|
* [isNumber](#isnumber)
|
|
72
72
|
* [isJSONString](#isjsonstring)
|
|
73
73
|
* [isValidData](#isvaliddata)
|
|
74
|
-
* [
|
|
74
|
+
* [genRndNumString](#genrndnumstring)
|
|
75
75
|
* [formatDate](#formatdate)
|
|
76
76
|
* [debounce](#debounce)
|
|
77
77
|
* [throttle](#throttle)
|
|
78
78
|
* [convertCamelToKebab](#convertcameltokebab)
|
|
79
79
|
* [convertCamelToUnder](#convertcameltounder)
|
|
80
|
-
* [
|
|
81
|
-
* [mTrim](#mtrim)
|
|
80
|
+
* [deepCopy](#deepcopy)
|
|
82
81
|
- [URL](#url)
|
|
83
82
|
* [getQueryParam](#getqueryparam)
|
|
84
83
|
* [getUrlParam](#geturlparam)
|
|
@@ -94,8 +93,8 @@ There ara some examples maintained by hand below. For more information, please c
|
|
|
94
93
|
* [newLine](#newline)
|
|
95
94
|
- [Calculate and Formula](#calculate-and-formula)
|
|
96
95
|
* [inRate](#inrate)
|
|
97
|
-
* [
|
|
98
|
-
* [
|
|
96
|
+
* [longestComSubstring](#longestcomsubstring)
|
|
97
|
+
* [longestComSubsequence](#longestcomsubsequence)
|
|
99
98
|
- [Browser Information](#browser-information)
|
|
100
99
|
* [getBrowserInfo](#getbrowserinfo)
|
|
101
100
|
* [isSafePWAEnv](#issafepwaenv)
|
|
@@ -308,19 +307,15 @@ isValidDataResC: false
|
|
|
308
307
|
@returns {boolean} Return TRUE if the data is valid.
|
|
309
308
|
@category Util -->
|
|
310
309
|
|
|
311
|
-
####
|
|
310
|
+
#### genRndNumString
|
|
312
311
|
|
|
313
|
-
Produce a random string of number, `
|
|
312
|
+
Produce a random string of number, `genRndNumString(7)` => '7658495'.
|
|
314
313
|
|
|
315
314
|
```
|
|
316
|
-
|
|
317
|
-
|
|
315
|
+
genRndNumString(4); // '9730'
|
|
316
|
+
genRndNumString(7); // '2262490'
|
|
318
317
|
```
|
|
319
318
|
|
|
320
|
-
<!-- @param {number} n Length
|
|
321
|
-
@returns {string} Return the random string.
|
|
322
|
-
@category Util -->
|
|
323
|
-
|
|
324
319
|
#### formatDate
|
|
325
320
|
|
|
326
321
|
Return the formatted date string in the given format.
|
|
@@ -404,15 +399,15 @@ convertCamelToUnder('aBC'); // a_b_c
|
|
|
404
399
|
@returns {string} 'a_b_c'
|
|
405
400
|
@category Util -->
|
|
406
401
|
|
|
407
|
-
####
|
|
402
|
+
#### deepCopy
|
|
408
403
|
|
|
409
|
-
Clone Object deeply.
|
|
404
|
+
Copy/Clone Object deeply.
|
|
410
405
|
|
|
411
406
|
Usage:
|
|
412
407
|
|
|
413
408
|
```
|
|
414
|
-
|
|
415
|
-
|
|
409
|
+
deepCopy(['a', 'b', 'c']);
|
|
410
|
+
deepCopy('abc');
|
|
416
411
|
```
|
|
417
412
|
|
|
418
413
|
Output:
|
|
@@ -422,23 +417,6 @@ Output:
|
|
|
422
417
|
'abc'
|
|
423
418
|
```
|
|
424
419
|
|
|
425
|
-
<!-- @param {object} obj The value to clone.
|
|
426
|
-
@returns {object} Returns the deep cloned value.
|
|
427
|
-
@category Util -->
|
|
428
|
-
|
|
429
|
-
#### mTrim
|
|
430
|
-
|
|
431
|
-
Remove leading and trailing whitespace or specified characters from string.
|
|
432
|
-
|
|
433
|
-
```
|
|
434
|
-
mTrim(' 1 2 3 '); // '1 2 3'
|
|
435
|
-
mTrim('abc '); // 'abc'
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
<!-- @param {string} str The string to trim.
|
|
439
|
-
@returns {string} Trimmed string.
|
|
440
|
-
@category Util -->
|
|
441
|
-
|
|
442
420
|
### URL
|
|
443
421
|
|
|
444
422
|
#### getQueryParam
|
|
@@ -707,16 +685,14 @@ console.log(trueCount, falseCount); // 499994 500006
|
|
|
707
685
|
@returns {boolean} true 命中
|
|
708
686
|
@category Calculate and Formula -->
|
|
709
687
|
|
|
710
|
-
####
|
|
688
|
+
#### longestComSubstring
|
|
711
689
|
|
|
712
690
|
Computes the longest common substring of two strings.
|
|
713
691
|
|
|
714
|
-
<!-- ZH: 计算两个字符串的最长公共子串 -->
|
|
715
|
-
|
|
716
692
|
Usage:
|
|
717
693
|
|
|
718
694
|
```
|
|
719
|
-
|
|
695
|
+
longestComSubstring('fish', 'finish');
|
|
720
696
|
```
|
|
721
697
|
|
|
722
698
|
Output:
|
|
@@ -725,21 +701,14 @@ Output:
|
|
|
725
701
|
3
|
|
726
702
|
```
|
|
727
703
|
|
|
728
|
-
|
|
729
|
-
@param {string} bStr String
|
|
730
|
-
@returns {number} Length
|
|
731
|
-
@category Calculate and Formula -->
|
|
732
|
-
|
|
733
|
-
#### calLongestCommonSubsequence
|
|
704
|
+
#### longestComSubsequence
|
|
734
705
|
|
|
735
706
|
Computes the longest common subsequence of two strings.
|
|
736
707
|
|
|
737
|
-
<!-- ZH: 计算两个字符串的最长公共子序列 -->
|
|
738
|
-
|
|
739
708
|
Usage:
|
|
740
709
|
|
|
741
710
|
```
|
|
742
|
-
|
|
711
|
+
longestComSubsequence('fish', 'finish');
|
|
743
712
|
```
|
|
744
713
|
|
|
745
714
|
Output:
|
|
@@ -748,11 +717,6 @@ Output:
|
|
|
748
717
|
4
|
|
749
718
|
```
|
|
750
719
|
|
|
751
|
-
<!-- @param {string} aStr 字符串
|
|
752
|
-
@param {string} bStr 字符串
|
|
753
|
-
@returns {number} 长度
|
|
754
|
-
@category Calculate and Formula -->
|
|
755
|
-
|
|
756
720
|
### Browser Information
|
|
757
721
|
|
|
758
722
|
#### getBrowserInfo
|