mazey 3.9.4 → 3.9.5
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 +6 -6
- package/lib/index.cjs.js +1 -1
- package/lib/index.d.ts +8 -8
- package/lib/index.esm.js +1 -1
- package/lib/mazey.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ Import from CDN.
|
|
|
55
55
|
|
|
56
56
|
## API Examples
|
|
57
57
|
|
|
58
|
-
There
|
|
58
|
+
There are some examples maintained by hand below. For more information, please check the [full documentation](https://mazey.cn/t/m).
|
|
59
59
|
|
|
60
60
|
**Table of Contents**
|
|
61
61
|
|
|
@@ -206,7 +206,7 @@ loadImage('https://example.com/example.png')
|
|
|
206
206
|
|
|
207
207
|
#### windowLoaded
|
|
208
208
|
|
|
209
|
-
Check whether the page is loaded successfully (
|
|
209
|
+
Check whether the page is loaded successfully (Keep the compatibility if the browser's `load` event has been triggered).
|
|
210
210
|
|
|
211
211
|
<!-- ZH: 页面加载完成 -->
|
|
212
212
|
|
|
@@ -556,7 +556,7 @@ getCookie('test'); // 123
|
|
|
556
556
|
|
|
557
557
|
#### Storage
|
|
558
558
|
|
|
559
|
-
Handle Storage (Keep fit for JSON, it can
|
|
559
|
+
Handle Storage (Keep fit for JSON, it can transfer format automatically).
|
|
560
560
|
|
|
561
561
|
<!-- ZH: 存储/获取数据到 sessionStorage/localStorage -->
|
|
562
562
|
|
|
@@ -609,7 +609,7 @@ addStyle(
|
|
|
609
609
|
// </style>
|
|
610
610
|
```
|
|
611
611
|
|
|
612
|
-
Example 2: Add the `<style>` without `id`, and repeated invoking will
|
|
612
|
+
Example 2: Add the `<style>` without `id`, and repeated invoking will add a new one.
|
|
613
613
|
|
|
614
614
|
```
|
|
615
615
|
addStyle(
|
|
@@ -647,14 +647,14 @@ removeClass(dom, 'test');
|
|
|
647
647
|
|
|
648
648
|
#### newLine
|
|
649
649
|
|
|
650
|
-
Make a
|
|
650
|
+
Make a new line of HTML.
|
|
651
651
|
|
|
652
652
|
```
|
|
653
653
|
newLine('a\nb\nc'); // 'a<br />b<br />c'
|
|
654
654
|
newLine('a\n\nbc'); // 'a<br /><br />bc'
|
|
655
655
|
```
|
|
656
656
|
|
|
657
|
-
<!-- @param {string} str The string to make a
|
|
657
|
+
<!-- @param {string} str The string to make a new line.
|
|
658
658
|
@returns {string} A newline with `br`.
|
|
659
659
|
@category DOM -->
|
|
660
660
|
|
package/lib/index.cjs.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -222,14 +222,14 @@ export declare function camelCase2Underscore(camelCase: string): string;
|
|
|
222
222
|
*/
|
|
223
223
|
export declare function mTrim(str: string): string;
|
|
224
224
|
/**
|
|
225
|
-
* Make a
|
|
225
|
+
* Make a new line of HTML.
|
|
226
226
|
*
|
|
227
227
|
* ```
|
|
228
228
|
* newLine('a\nb\nc'); // 'a<br />b<br />c'
|
|
229
229
|
* newLine('a\n\nbc'); // 'a<br /><br />bc'
|
|
230
230
|
* ```
|
|
231
231
|
*
|
|
232
|
-
* @param {string} str The string to make a
|
|
232
|
+
* @param {string} str The string to make a new line.
|
|
233
233
|
* @returns {string} A newline with `br`.
|
|
234
234
|
* @category DOM
|
|
235
235
|
*/
|
|
@@ -475,7 +475,7 @@ export declare function isNumber(num: unknown, options?: IsNumberOptions): boole
|
|
|
475
475
|
*/
|
|
476
476
|
export declare function doFn(fn: AnyFunction, ...params: Parameters<AnyFunction>): ReturnType<AnyFunction> | null;
|
|
477
477
|
/**
|
|
478
|
-
* EN: Handle Storage (Keep fit for JSON, it can
|
|
478
|
+
* EN: Handle Storage (Keep fit for JSON, it can transfer format automatically).
|
|
479
479
|
*
|
|
480
480
|
* ZH: 存储/获取数据到 sessionStorage/localStorage
|
|
481
481
|
*
|
|
@@ -502,7 +502,7 @@ export declare function doFn(fn: AnyFunction, ...params: Parameters<AnyFunction>
|
|
|
502
502
|
*/
|
|
503
503
|
export declare function setSessionStorage<T>(key: string, value?: T | null): void;
|
|
504
504
|
/**
|
|
505
|
-
* EN: Handle Storage (Keep fit for JSON, it can
|
|
505
|
+
* EN: Handle Storage (Keep fit for JSON, it can transfer format automatically).
|
|
506
506
|
*
|
|
507
507
|
* ZH: 存储/获取数据到 sessionStorage/localStorage
|
|
508
508
|
*
|
|
@@ -529,7 +529,7 @@ export declare function setSessionStorage<T>(key: string, value?: T | null): voi
|
|
|
529
529
|
*/
|
|
530
530
|
export declare function getSessionStorage<T>(key: string): T | null;
|
|
531
531
|
/**
|
|
532
|
-
* EN: Handle Storage (Keep fit for JSON, it can
|
|
532
|
+
* EN: Handle Storage (Keep fit for JSON, it can transfer format automatically).
|
|
533
533
|
*
|
|
534
534
|
* ZH: 存储/获取数据到 sessionStorage/localStorage
|
|
535
535
|
*
|
|
@@ -556,7 +556,7 @@ export declare function getSessionStorage<T>(key: string): T | null;
|
|
|
556
556
|
*/
|
|
557
557
|
export declare function setLocalStorage<T>(key: string, value?: T | null): void;
|
|
558
558
|
/**
|
|
559
|
-
* EN: Handle Storage (Keep fit for JSON, it can
|
|
559
|
+
* EN: Handle Storage (Keep fit for JSON, it can transfer format automatically).
|
|
560
560
|
*
|
|
561
561
|
* ZH: 存储/获取数据到 sessionStorage/localStorage
|
|
562
562
|
*
|
|
@@ -889,7 +889,7 @@ export declare function truncateZHString(str: string, len: number, hasDot?: bool
|
|
|
889
889
|
*/
|
|
890
890
|
export declare function cutCHSString(str: string, len: number, hasDot?: boolean): string;
|
|
891
891
|
/**
|
|
892
|
-
* EN: Check whether the page is loaded successfully (
|
|
892
|
+
* EN: Check whether the page is loaded successfully (Keep the compatibility if the browser's `load` event has been triggered).
|
|
893
893
|
*
|
|
894
894
|
* ZH: 页面加载完成
|
|
895
895
|
*
|
|
@@ -933,7 +933,7 @@ export declare function windowLoaded(timeout?: number): Promise<string | Error>;
|
|
|
933
933
|
* // </style>
|
|
934
934
|
* ```
|
|
935
935
|
*
|
|
936
|
-
* Example 2: Add the `<style>` without `id`, and repeated invoking will
|
|
936
|
+
* Example 2: Add the `<style>` without `id`, and repeated invoking will add a new one.
|
|
937
937
|
*
|
|
938
938
|
* ```
|
|
939
939
|
* addStyle(
|
package/lib/index.esm.js
CHANGED
package/lib/mazey.min.js
CHANGED