mazey 4.7.3 → 4.7.4

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/typing.d.ts CHANGED
@@ -84,4 +84,6 @@ interface WebPerformance {
84
84
 
85
85
  type MazeyElement = HTMLElement | null;
86
86
 
87
- export type { AnyFunction, BrowserInfo, DebounceFunc, DefineListeners, IsNumberOptions, LoadScriptReturns, MazeyElement, MazeyFn, MazeyFnParams, MazeyFnReturn, MazeyFunction, MazeyObject, MazeyWindow, MultiValueUrlParams, RepeatUntilOptions, SimpleObject, SimpleType, SingleValueUrlParams, TestUa, TestVs, ThrottleFunc, WebPerformance, ZResIsValidResOptions, ZResResponse };
87
+ type MazeyDate = Date | string | number;
88
+
89
+ export type { AnyFunction, BrowserInfo, DebounceFunc, DefineListeners, IsNumberOptions, LoadScriptReturns, MazeyDate, MazeyElement, MazeyFn, MazeyFnParams, MazeyFnReturn, MazeyFunction, MazeyObject, MazeyWindow, MultiValueUrlParams, RepeatUntilOptions, SimpleObject, SimpleType, SingleValueUrlParams, TestUa, TestVs, ThrottleFunc, WebPerformance, ZResIsValidResOptions, ZResResponse };
package/lib/url.d.ts CHANGED
@@ -7,8 +7,8 @@ import type { SingleValueUrlParams } from "./typing";
7
7
  * ```javascript
8
8
  * // http://example.com/?t1=1&t2=2&t3=3&t4=4#2333
9
9
  * // ?t1=1&t2=2&t3=3&t4=4
10
- * const p1 = getQueryParam('t3');
11
- * const p2 = getQueryParam('t4');
10
+ * const p1 = getQueryParam("t3");
11
+ * const p2 = getQueryParam("t4");
12
12
  * console.log(p1, p2);
13
13
  * ```
14
14
  *
@@ -38,7 +38,7 @@ export declare function getQueryParam(param: string): string;
38
38
  * Output:
39
39
  *
40
40
  * ```text
41
- * { t1: '1', t2: '2', t3: '3', t4: '4' }
41
+ * { t1: "1", t2: "2", t3: "3", t4: "4" }
42
42
  * ```
43
43
  *
44
44
  * @param {string} url Optional, The URL string.
@@ -52,8 +52,8 @@ export declare function getAllQueryParams(url?: string): SingleValueUrlParams;
52
52
  * Usage:
53
53
  *
54
54
  * ```javascript
55
- * const p1 = getUrlParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't3');
56
- * const p2 = getUrlParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't4');
55
+ * const p1 = getUrlParam("http://example.com/?t1=1&t2=2&t3=3&t4=4", "t3");
56
+ * const p2 = getUrlParam("http://example.com/?t1=1&t2=2&t3=3&t4=4", "t4");
57
57
  * console.log(p1, p2);
58
58
  * ```
59
59
  *
@@ -79,8 +79,8 @@ export declare function getUrlParam(url: string, param: string, options?: {
79
79
  * Usage:
80
80
  *
81
81
  * ```javascript
82
- * const ret1 = updateQueryParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't3', 'three');
83
- * const ret2 = updateQueryParam('http://example.com/?t1=1&t2=2&t3=3&t4=4', 't4', 'four');
82
+ * const ret1 = updateQueryParam("http://example.com/?t1=1&t2=2&t3=3&t4=4", "t3", "three");
83
+ * const ret2 = updateQueryParam("http://example.com/?t1=1&t2=2&t3=3&t4=4", "t4", "four");
84
84
  * console.log(ret1);
85
85
  * console.log(ret2);
86
86
  * ```
@@ -107,8 +107,8 @@ export declare function updateQueryParam(url: string, param: string, value: stri
107
107
  * ```javascript
108
108
  * // http://example.com/?#2333?t1=1&t2=2&t3=3&t4=4
109
109
  * // #2333?t1=1&t2=2&t3=3&t4=4
110
- * const p1 = getHashQueryParam('t3');
111
- * const p2 = getHashQueryParam('t4');
110
+ * const p1 = getHashQueryParam("t3");
111
+ * const p2 = getHashQueryParam("t4");
112
112
  * console.log(p1, p2);
113
113
  * ```
114
114
  *
@@ -129,12 +129,12 @@ export declare function getHashQueryParam(param: string): string;
129
129
  * Usage:
130
130
  *
131
131
  * ```javascript
132
- * const ret1 = getDomain('http://example.com/?t1=1&t2=2&t3=3&t4=4');
133
- * const ret2 = getDomain('http://example.com/test/thanks?t1=1&t2=2&t3=3&t4=4', ['hostname', 'pathname']);
134
- * const ret3 = getDomain('http://example.com:7890/test/thanks', ['hostname']);
135
- * const ret4 = getDomain('http://example.com:7890/test/thanks', ['host']); // With Port
136
- * const ret5 = getDomain('http://example.com:7890/test/thanks', ['origin']);
137
- * const ret6 = getDomain('http://example.com:7890/test/thanks?id=1', ['origin', 'pathname', 'search']);
132
+ * const ret1 = getDomain("http://example.com/?t1=1&t2=2&t3=3&t4=4");
133
+ * const ret2 = getDomain("http://example.com/test/thanks?t1=1&t2=2&t3=3&t4=4", ["hostname", "pathname"]);
134
+ * const ret3 = getDomain("http://example.com:7890/test/thanks", ["hostname"]);
135
+ * const ret4 = getDomain("http://example.com:7890/test/thanks", ["host"]); // With Port
136
+ * const ret5 = getDomain("http://example.com:7890/test/thanks", ["origin"]);
137
+ * const ret6 = getDomain("http://example.com:7890/test/thanks?id=1", ["origin", "pathname", "search"]);
138
138
  * console.log(ret1);
139
139
  * console.log(ret2);
140
140
  * console.log(ret3);
@@ -155,7 +155,7 @@ export declare function getHashQueryParam(param: string): string;
155
155
  * ```
156
156
  *
157
157
  * @param {string} url
158
- * @param {array} rules Object.keys(location), ['href', 'origin', 'protocol', 'host', 'hostname', 'port', 'pathname', 'search', 'hash'], ['hostname', 'pathname'] = 'km.mazey.net/plugins/servlet/mobile'
158
+ * @param {array} rules Object.keys(location), ["href", "origin", "protocol", "host", "hostname", "port", "pathname", "search", "hash"], ["hostname", "pathname"] = "km.mazey.net/plugins/servlet/mobile"
159
159
  * @category URL
160
160
  */
161
161
  export declare function getDomain(url: string, rules?: string[]): string;
@@ -165,11 +165,11 @@ export declare function getDomain(url: string, rules?: string[]): string;
165
165
  * Usage:
166
166
  *
167
167
  * ```javascript
168
- * const ret1 = isValidUrl('https://www.example.com');
169
- * const ret2 = isValidUrl('http://example.com/path/exx/ss');
170
- * const ret3 = isValidUrl('https://www.example.com/?q=hello&age=24#world');
171
- * const ret4 = isValidUrl('http://www.example.com/#world?id=9');
172
- * const ret5 = isValidUrl('ftp://example.com');
168
+ * const ret1 = isValidUrl("https://www.example.com");
169
+ * const ret2 = isValidUrl("http://example.com/path/exx/ss");
170
+ * const ret3 = isValidUrl("https://www.example.com/?q=hello&age=24#world");
171
+ * const ret4 = isValidUrl("http://www.example.com/#world?id=9");
172
+ * const ret5 = isValidUrl("ftp://example.com");
173
173
  * console.log(ret1, ret2, ret3, ret4, ret5);
174
174
  * ```
175
175
  *
@@ -194,12 +194,12 @@ export declare function isValidUrl(url: string): boolean;
194
194
  * Usage:
195
195
  *
196
196
  * ```javascript
197
- * const ret1 = isValidHttpUrl('https://www.example.com');
198
- * const ret2 = isValidHttpUrl('http://example.com/path/exx/ss');
199
- * const ret3 = isValidHttpUrl('https://www.example.com/?q=hello&age=24#world');
200
- * const ret4 = isValidHttpUrl('http://www.example.com/#world?id=9');
201
- * const ret5 = isValidHttpUrl('//example.com/a/b/c?q=1', { strict: false });
202
- * const ret6 = isValidHttpUrl('ftp://example.com');
197
+ * const ret1 = isValidHttpUrl("https://www.example.com");
198
+ * const ret2 = isValidHttpUrl("http://example.com/path/exx/ss");
199
+ * const ret3 = isValidHttpUrl("https://www.example.com/?q=hello&age=24#world");
200
+ * const ret4 = isValidHttpUrl("http://www.example.com/#world?id=9");
201
+ * const ret5 = isValidHttpUrl("//example.com/a/b/c?q=1", { strict: false });
202
+ * const ret6 = isValidHttpUrl("ftp://example.com");
203
203
  * console.log(ret1, ret2, ret3, ret4, ret5, ret6);
204
204
  * ```
205
205
  *
@@ -225,18 +225,18 @@ export declare function isValidHttpUrl(url: string, options?: {
225
225
  * Usage:
226
226
  *
227
227
  * ```javascript
228
- * const ret1 = getUrlFileType('https://example.com/a/b/c.png');
229
- * const ret2 = getUrlFileType('https://example.com/a/b/c.jpg');
230
- * const ret3 = getUrlFileType('https://example.com/a/b/c.jpeg');
231
- * const ret4 = getUrlFileType('/a/b/c.jpeg');
232
- * const ret5 = getUrlFileType('https://example.com/a/b/c.v/a');
228
+ * const ret1 = getUrlFileType("https://example.com/a/b/c.png");
229
+ * const ret2 = getUrlFileType("https://example.com/a/b/c.jpg");
230
+ * const ret3 = getUrlFileType("https://example.com/a/b/c.jpeg");
231
+ * const ret4 = getUrlFileType("/a/b/c.jpeg");
232
+ * const ret5 = getUrlFileType("https://example.com/a/b/c.v/a");
233
233
  * console.log(ret1, ret2, ret3, ret4, ret5);
234
234
  * ```
235
235
  *
236
236
  * Output:
237
237
  *
238
238
  * ```text
239
- * png jpg jpeg jpeg ''
239
+ * png jpg jpeg jpeg ""
240
240
  * ```
241
241
  *
242
242
  * @param url
@@ -250,7 +250,7 @@ export declare function getUrlFileType(url: string): boolean | string;
250
250
  * Usage:
251
251
  *
252
252
  * ```javascript
253
- * const ret = getScriptQueryParam('test', 'https://example.com/example.js');
253
+ * const ret = getScriptQueryParam("test", "https://example.com/example.js");
254
254
  * console.log(ret);
255
255
  * ```
256
256
  *
@@ -273,7 +273,7 @@ export declare function getScriptQueryParam(param: string, matchString?: string)
273
273
  * Usage:
274
274
  *
275
275
  * ```javascript
276
- * const ret = convertObjectToQuery({ t1: '1', t2: '2', t3: '3', t4: '4' });
276
+ * const ret = convertObjectToQuery({ t1: "1", t2: "2", t3: "3", t4: "4" });
277
277
  * console.log(ret);
278
278
  * ```
279
279
  *
@@ -296,7 +296,7 @@ export declare function convertObjectToQuery(obj: {
296
296
  * Usage:
297
297
  *
298
298
  * ```javascript
299
- * const ret = convertHttpToHttps('http://example.com');
299
+ * const ret = convertHttpToHttps("http://example.com");
300
300
  * console.log(ret);
301
301
  * ```
302
302
  *
@@ -325,7 +325,7 @@ export declare function replaceHttp(url: string): string;
325
325
  * ```javascript
326
326
  * import { getUrlHost } from "mazey";
327
327
  *
328
- * const ret = getUrlHost('https://example.com/path/to/page');
328
+ * const ret = getUrlHost("https://example.com/path/to/page");
329
329
  * console.log(ret);
330
330
  * ```
331
331
  *
@@ -348,7 +348,7 @@ export declare function getUrlHost(url: string): string;
348
348
  * ```javascript
349
349
  * import { getUrlPath } from "mazey";
350
350
  *
351
- * const ret = getUrlPath('https://example.com/path/to/page');
351
+ * const ret = getUrlPath("https://example.com/path/to/page");
352
352
  * console.log(ret);
353
353
  * ```
354
354
  *
package/lib/util.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ThrottleFunc, DebounceFunc, IsNumberOptions, ZResResponse, ZResIsValidResOptions, SimpleType, MazeyObject, MazeyFnParams, MazeyFnReturn, MazeyFunction, RepeatUntilOptions } from "./typing";
1
+ import type { ThrottleFunc, DebounceFunc, IsNumberOptions, ZResResponse, ZResIsValidResOptions, SimpleType, MazeyDate, MazeyObject, MazeyFnParams, MazeyFnReturn, MazeyFunction, RepeatUntilOptions } from "./typing";
2
2
  /**
3
3
  * Copy/Clone Object deeply.
4
4
  *
@@ -35,8 +35,8 @@ export declare function deepCopyObject<T>(obj: T): T;
35
35
  * Usage:
36
36
  *
37
37
  * ```javascript
38
- * const ret1 = convertCamelToKebab('ABC');
39
- * const ret2 = convertCamelToKebab('aBC');
38
+ * const ret1 = convertCamelToKebab("ABC");
39
+ * const ret2 = convertCamelToKebab("aBC");
40
40
  * console.log(ret1);
41
41
  * console.log(ret2);
42
42
  * ```
@@ -48,8 +48,8 @@ export declare function deepCopyObject<T>(obj: T): T;
48
48
  * a-b-c
49
49
  * ```
50
50
  *
51
- * @param {string} camelCase 'aBC' or 'ABC'
52
- * @returns {string} 'a-b-c'
51
+ * @param {string} camelCase "aBC" or "ABC"
52
+ * @returns {string} "a-b-c"
53
53
  * @category Util
54
54
  */
55
55
  export declare function convertCamelToKebab(camelCase: string): string;
@@ -73,8 +73,8 @@ export declare function camelCaseToKebabCase(camelCase: string): string;
73
73
  * Usage:
74
74
  *
75
75
  * ```javascript
76
- * const ret1 = convertCamelToUnder('ABC');
77
- * const ret2 = convertCamelToUnder('aBC');
76
+ * const ret1 = convertCamelToUnder("ABC");
77
+ * const ret2 = convertCamelToUnder("aBC");
78
78
  * console.log(ret1);
79
79
  * console.log(ret2);
80
80
  * ```
@@ -86,8 +86,8 @@ export declare function camelCaseToKebabCase(camelCase: string): string;
86
86
  * a_b_c
87
87
  * ```
88
88
  *
89
- * @param {string} camelCase 'aBC' or 'ABC'
90
- * @returns {string} 'a_b_c'
89
+ * @param {string} camelCase "aBC" or "ABC"
90
+ * @returns {string} "a_b_c"
91
91
  * @category Util
92
92
  */
93
93
  export declare function convertCamelToUnder(camelCase: string): string;
@@ -105,8 +105,8 @@ export declare function camelCase2Underscore(camelCase: string): string;
105
105
  * Usage:
106
106
  *
107
107
  * ```javascript
108
- * const ret1 = mTrim(' 1 2 3 ');
109
- * const ret2 = mTrim('abc ');
108
+ * const ret1 = mTrim(" 1 2 3 ");
109
+ * const ret2 = mTrim("abc ");
110
110
  * console.log(ret1);
111
111
  * console.log(ret2);
112
112
  * ```
@@ -155,7 +155,7 @@ export declare function isJSONString(str: string): boolean;
155
155
  */
156
156
  export declare function isJsonString(str: string): boolean;
157
157
  /**
158
- * Produce a random string of number, `genRndNumString(7)` => '7658495'.
158
+ * Produce a random string of number, `genRndNumString(7)` => "7658495".
159
159
  *
160
160
  * Usage:
161
161
  *
@@ -295,7 +295,7 @@ export declare function floatFixed(num: string, size?: number): string;
295
295
  *
296
296
  * ```javascript
297
297
  * const foo = throttle(() => {
298
- * console.log('The function will be invoked at most once per every wait 1000 milliseconds.');
298
+ * console.log("The function will be invoked at most once per every wait 1000 milliseconds.");
299
299
  * }, 1000, { leading: true });
300
300
  * ```
301
301
  *
@@ -316,7 +316,7 @@ export declare function throttle<T extends (...args: MazeyFnParams) => MazeyFnRe
316
316
  *
317
317
  * ```javascript
318
318
  * const foo = debounce(() => {
319
- * console.log('The debounced function will only be invoked in 1000 milliseconds, the other invoking will disappear during the wait time.');
319
+ * console.log("The debounced function will only be invoked in 1000 milliseconds, the other invoking will disappear during the wait time.");
320
320
  * }, 1000, true);
321
321
  * ```
322
322
  *
@@ -331,9 +331,9 @@ export declare function debounce<T extends (...args: MazeyFnParams) => MazeyFnRe
331
331
  * Usage:
332
332
  *
333
333
  * ```javascript
334
- * const ret1 = getFriendlyInterval(new Date('2020-03-28 00:09:27'), new Date('2023-04-18 10:54:00'), { type: 'd' });
335
- * const ret2 = getFriendlyInterval(1585325367000, 1681786440000, { type: 'text' });
336
- * const ret3 = getFriendlyInterval('2020-03-28 00:09:27', '2023-04-18 10:54:00', { type: 'text' });
334
+ * const ret1 = getFriendlyInterval(new Date("2020-03-28 00:09:27"), new Date("2023-04-18 10:54:00"), { type: "d" });
335
+ * const ret2 = getFriendlyInterval(1585325367000, 1681786440000, { type: "text" });
336
+ * const ret3 = getFriendlyInterval("2020-03-28 00:09:27", "2023-04-18 10:54:00", { type: "text" });
337
337
  * console.log(ret1);
338
338
  * console.log(ret2);
339
339
  * console.log(ret3);
@@ -365,7 +365,7 @@ export declare function getFriendlyInterval(start?: number | string | Date, end?
365
365
  *
366
366
  * ```javascript
367
367
  * const ret1 = isNumber(123);
368
- * const ret2 = isNumber('123');
368
+ * const ret2 = isNumber("123");
369
369
  * // Default: NaN, Infinity is not Number
370
370
  * const ret3 = isNumber(Infinity);
371
371
  * const ret4 = isNumber(Infinity, { isInfinityAsNumber: true });
@@ -396,7 +396,7 @@ export declare function isNumber(num: unknown, options?: IsNumberOptions): boole
396
396
  *
397
397
  * ```javascript
398
398
  * const ret = invokeFn(() => {
399
- * console.log('invokeFn');
399
+ * console.log("invokeFn");
400
400
  * });
401
401
  * ```
402
402
  *
@@ -435,10 +435,10 @@ export declare function isNonEmptyArray<T>(arr: Array<T>): boolean;
435
435
  * Usage:
436
436
  *
437
437
  * ```javascript
438
- * import { isPureObject } from 'mazey';
438
+ * import { isPureObject } from "mazey";
439
439
  *
440
440
  * const ret1 = isPureObject({ a: 1 });
441
- * const ret2 = isPureObject('abc');
441
+ * const ret2 = isPureObject("abc");
442
442
  * const ret3 = isPureObject(null);
443
443
  * const ret4 = isPureObject([]);
444
444
  *
@@ -456,6 +456,32 @@ export declare function isNonEmptyArray<T>(arr: Array<T>): boolean;
456
456
  * @category Util
457
457
  */
458
458
  export declare function isPureObject(obj: MazeyObject): boolean;
459
+ /**
460
+ * Verify the validity of an array.
461
+ *
462
+ * Usage:
463
+ *
464
+ * ```javascript
465
+ * import { isArray } from "mazey";
466
+ *
467
+ * const ret1 = isArray([1, 2, 3]);
468
+ * const ret2 = isArray({ a: 1 });
469
+ * const ret3 = isArray("abc");
470
+ * const ret4 = isArray(null);
471
+ * console.log(ret1, ret2, ret3, ret4);
472
+ * ```
473
+ *
474
+ * Output:
475
+ *
476
+ * ```text
477
+ * true false false false
478
+ * ```
479
+ *
480
+ * @param {MazeyObject} obj The object to verify.
481
+ * @returns {boolean} Return TRUE if the object is an array.
482
+ * @category Util
483
+ */
484
+ export declare function isArray(obj: MazeyObject): boolean;
459
485
  /**
460
486
  * Verify the validity of a non-empty object.
461
487
  *
@@ -487,8 +513,8 @@ export declare function isNonEmptyObject(obj: MazeyObject): boolean;
487
513
  * Usage:
488
514
  *
489
515
  * ```javascript
490
- * const ret1 = convertToHtmlBreaks('a\nb\nc');
491
- * const ret2 = convertToHtmlBreaks('a\n\nbc');
516
+ * const ret1 = convertToHtmlBreaks("a\nb\nc");
517
+ * const ret2 = convertToHtmlBreaks("a\n\nbc");
492
518
  * console.log(ret1);
493
519
  * console.log(ret2);
494
520
  * ```
@@ -517,7 +543,7 @@ export declare function newLine(str: string): string;
517
543
  * Usage:
518
544
  *
519
545
  * ```javascript
520
- * const ret = removeHTML('<div>hello world</div>');
546
+ * const ret = removeHTML("<div>hello world</div>");
521
547
  * console.log(ret);
522
548
  * ```
523
549
  *
@@ -564,7 +590,7 @@ export declare function clearHtml(str: string, options?: {
564
590
  * Usage:
565
591
  *
566
592
  * ```javascript
567
- * const ret = sanitizeInput('<div>hello world</div>');
593
+ * const ret = sanitizeInput("<div>hello world</div>");
568
594
  * console.log(ret);
569
595
  * ```
570
596
  *
@@ -585,7 +611,7 @@ export declare function sanitizeInput(input: string): string;
585
611
  * Usage:
586
612
  *
587
613
  * ```javascript
588
- * const ret = unsanitizeInput('&lt;div&gt;hello world&lt;/div&gt;');
614
+ * const ret = unsanitizeInput("&lt;div&gt;hello world&lt;/div&gt;");
589
615
  * console.log(ret);
590
616
  * ```
591
617
  *
@@ -614,7 +640,7 @@ export declare function unsanitize(str: string): string;
614
640
  * Usage:
615
641
  *
616
642
  * ```javascript
617
- * const ret = cutZHString('hello world', 5);
643
+ * const ret = cutZHString("hello world", 5);
618
644
  * console.log(ret);
619
645
  * ```
620
646
  *
@@ -641,7 +667,7 @@ export declare function cutZHString(str: string, len: number, options?: {
641
667
  * Usage:
642
668
  *
643
669
  * ```javascript
644
- * const ret = truncateZHString('hello world', 5);
670
+ * const ret = truncateZHString("hello world", 5);
645
671
  * console.log(ret);
646
672
  * ```
647
673
  *
@@ -685,12 +711,12 @@ export declare function zAxiosIsValidRes(res: ZResResponse | undefined, options?
685
711
  * }
686
712
  * }
687
713
  * };
688
- * const isValidDataResA = isValidData(validData, ['a', 'b', 'c'], 2333);
689
- * const isValidDataResB = isValidData(validData, ['a', 'b', 'c'], 413);
690
- * const isValidDataResC = isValidData(validData, ['d', 'd'], 413);
691
- * console.log('isValidDataResA:', isValidDataResA);
692
- * console.log('isValidDataResB:', isValidDataResB);
693
- * console.log('isValidDataResC:', isValidDataResC);
714
+ * const isValidDataResA = isValidData(validData, ["a", "b", "c"], 2333);
715
+ * const isValidDataResB = isValidData(validData, ["a", "b", "c"], 413);
716
+ * const isValidDataResC = isValidData(validData, ["d", "d"], 413);
717
+ * console.log("isValidDataResA:", isValidDataResA);
718
+ * console.log("isValidDataResB:", isValidDataResB);
719
+ * console.log("isValidDataResC:", isValidDataResC);
694
720
  * ```
695
721
  *
696
722
  * Output:
@@ -735,7 +761,7 @@ export declare function getFileSize(size: number): string;
735
761
  * Usage:
736
762
  *
737
763
  * ```javascript
738
- * const ret = genHashCode('hello world');
764
+ * const ret = genHashCode("hello world");
739
765
  * console.log(ret);
740
766
  * ```
741
767
  *
@@ -757,13 +783,13 @@ export declare function genHashCode(str: string): number;
757
783
  *
758
784
  * ```javascript
759
785
  * const ret1 = formatDate();
760
- * const ret2 = formatDate('Tue Jan 11 2022 14:12:26 GMT+0800 (China Standard Time)', 'yyyy-MM-dd hh:mm:ss a');
761
- * const ret3 = formatDate(1641881235000, 'yyyy-MM-dd hh:mm:ss a');
762
- * const ret4 = formatDate(new Date(2014, 1, 11), 'MM/dd/yyyy');
763
- * console.log('Default formatDate value:', ret1);
764
- * console.log('String formatDate value:', ret2);
765
- * console.log('Number formatDate value:', ret3);
766
- * console.log('Date formatDate value:', ret4);
786
+ * const ret2 = formatDate("Tue Jan 11 2022 14:12:26 GMT+0800 (China Standard Time)", "yyyy-MM-dd hh:mm:ss a");
787
+ * const ret3 = formatDate(1641881235000, "yyyy-MM-dd hh:mm:ss a");
788
+ * const ret4 = formatDate(new Date(2014, 1, 11), "MM/dd/yyyy");
789
+ * console.log("Default formatDate value:", ret1);
790
+ * console.log("String formatDate value:", ret2);
791
+ * console.log("Number formatDate value:", ret3);
792
+ * console.log("Date formatDate value:", ret4);
767
793
  * ```
768
794
  *
769
795
  * Output:
@@ -775,22 +801,22 @@ export declare function genHashCode(str: string): number;
775
801
  * Date formatDate value: 02/11/2014
776
802
  * ```
777
803
  *
778
- * @param {Date|number|string} dateIns Original Date
804
+ * @param {MazeyDate} dateIns Original Date
779
805
  * @param {string} format Format String
780
806
  * @returns {string} Return the formatted date string.
781
807
  * @category Util
782
808
  */
783
- export declare function formatDate(dateIns?: Date | number | string, format?: string): string;
809
+ export declare function formatDate(dateIns?: MazeyDate, format?: string): string;
784
810
  /**
785
811
  * Check if the given string is a mobile phone number.
786
812
  *
787
813
  * Usage:
788
814
  *
789
815
  * ```javascript
790
- * const ret1 = isMobile('13800138000');
791
- * const ret2 = isMobile('1380013800');
792
- * const ret3 = isMobile('138001380000');
793
- * const ret4 = isMobile('1380013800a');
816
+ * const ret1 = isMobile("13800138000");
817
+ * const ret2 = isMobile("1380013800");
818
+ * const ret3 = isMobile("138001380000");
819
+ * const ret4 = isMobile("1380013800a");
794
820
  * console.log(ret1, ret2, ret3, ret4);
795
821
  * ```
796
822
  *
@@ -811,7 +837,7 @@ export declare function isValidPhoneNumber(mobile: string): boolean;
811
837
  * Usage:
812
838
  *
813
839
  * ```javascript
814
- * const ret = isValidEmail('mazeyqian@gmail.com');
840
+ * const ret = isValidEmail("mazeyqian@gmail.com");
815
841
  * console.log(ret);
816
842
  * ```
817
843
  *
@@ -865,7 +891,7 @@ export declare function getCurrentVersion(): string;
865
891
  * ```javascript
866
892
  * repeatUntilConditionMet(
867
893
  * () => {
868
- * console.log('repeatUntilConditionMet');
894
+ * console.log("repeatUntilConditionMet");
869
895
  * return true;
870
896
  * }, {
871
897
  * interval: 1000,
@@ -895,7 +921,7 @@ export declare function repeatUntilConditionMet<T extends (...args: MazeyFnParam
895
921
  *
896
922
  * ```javascript
897
923
  * waitTime(1000).then((time) => {
898
- * console.log('waitTime:', time);
924
+ * console.log("waitTime:", time);
899
925
  * });
900
926
  * ```
901
927
  *
package/lib/util.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAAE,YAAY,EAAE,eAAe,EAC3C,YAAY,EAAE,qBAAqB,EACrB,UAAU,EACxB,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EACxD,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAgBrC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAE3C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED;;;;;;GAMG;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C,MAAM,CAAC,CAEzD;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,IAAI,OAAO,CASnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mazey",
3
- "version": "4.7.3",
3
+ "version": "4.7.4",
4
4
  "description": "A functional library for daily front-end work.",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",
package/scripts/README.md CHANGED
@@ -7,7 +7,7 @@ Release this project with version by `process.env.VERSION` or `package.json`.
7
7
  Usage:
8
8
 
9
9
  ```javascript
10
- const pkgVersion = process.env.VERSION || require('../package.json').version;
10
+ const pkgVersion = process.env.VERSION || require("../package.json").version;
11
11
  release(pkgVersion);
12
12
  ```
13
13
 
package/scripts/dev.js CHANGED
@@ -1,23 +1,7 @@
1
1
  /* eslint-disable no-undef */
2
2
  /* eslint-disable @typescript-eslint/no-var-requires */
3
- // const execa = require('execa');
4
3
  const { generateToc } = require("./build-helper");
5
4
 
6
5
  (async () => {
7
- // const { stdout: pushMsg = '' } = await execa('git', ['push'], { stdio: 'pipe' })
8
- // .catch(error => {
9
- // console.log('error:', error.message);
10
- // });
11
- // try {
12
- // await execa('git', ['push'], { stdio: 'pipe' });
13
- // } catch (error) {
14
- // console.log('error:', error.message);
15
- // const { stdout: currentBranch } = await execa('git', ['branch', '--show-current'], { stdio: 'pipe' });
16
- // console.log('currentBranch:', currentBranch); // currentBranch: fix/rollup_dependences_mon_oct_31st_2022
17
- // await execa('git', ['push', '--set-upstream', 'origin', currentBranch]);
18
- // }
19
- // console.log('pushMsg:', pushMsg);
20
- // const cb = await getGitCurrentBranch('fix returns value');
21
- // console.log('bbb', cb);
22
6
  generateToc();
23
7
  })();
@@ -9,7 +9,7 @@ const execa = require("execa");
9
9
  * Usage:
10
10
  *
11
11
  * ```javascript
12
- * const pkgVersion = process.env.VERSION || require('../package.json').version;
12
+ * const pkgVersion = process.env.VERSION || require("../package.json").version;
13
13
  * release(pkgVersion);
14
14
  * ```
15
15
  *
@@ -58,8 +58,8 @@ async function release (ver, { canGenerateToc = false, defaultBranch = "main" }
58
58
  await gitCommit(releaseVersion);
59
59
  // Push
60
60
  console.log("Pushing to the remote Git...");
61
- // await execa('git', ['tag', '-a', `${releaseVersion}`, '-m', `Release ${releaseVersion}`]);
62
- // await execa('git', ['push', 'origin', `refs/tags/${releaseVersion}`]);
61
+ // await execa("git", ["tag", "-a", `${releaseVersion}`, "-m", `Release ${releaseVersion}`]);
62
+ // await execa("git", ["push", "origin", `refs/tags/${releaseVersion}`]);
63
63
  await gitTagPush(releaseVersion);
64
64
  await gitPush();
65
65
  console.log("All done.");
@@ -70,7 +70,7 @@ async function release (ver, { canGenerateToc = false, defaultBranch = "main" }
70
70
  *
71
71
  * @example
72
72
  * ```
73
- * await gitTagPush('v1.0.0');
73
+ * await gitTagPush("v1.0.0");
74
74
  * ```
75
75
  *
76
76
  * @param {string} ver Release version