@daysnap/utils 0.0.57 → 0.0.59
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 +1 -0
- package/docs/README.md +2 -0
- package/docs/modules.md +453 -90
- package/es/cached.d.ts +5 -0
- package/es/cached.js +12 -0
- package/es/exitFullscreen.d.ts +6 -0
- package/es/exitFullscreen.js +27 -0
- package/es/getRandom.js +2 -4
- package/es/index.d.ts +7 -0
- package/es/index.js +7 -0
- package/es/isAmount.d.ts +11 -0
- package/es/isAmount.js +13 -0
- package/es/isChinese.d.ts +4 -0
- package/es/isChinese.js +6 -0
- package/es/isNativeFunction.d.ts +5 -0
- package/es/isNativeFunction.js +8 -0
- package/es/listGenerator.d.ts +5 -0
- package/es/listGenerator.js +7 -0
- package/es/requestFullScreen.d.ts +6 -0
- package/es/requestFullScreen.js +27 -0
- package/lib/cached.d.ts +5 -0
- package/lib/cached.js +16 -0
- package/lib/exitFullscreen.d.ts +6 -0
- package/lib/exitFullscreen.js +31 -0
- package/lib/getRandom.js +2 -4
- package/lib/index.d.ts +7 -0
- package/lib/index.js +7 -0
- package/lib/isAmount.d.ts +11 -0
- package/lib/isAmount.js +17 -0
- package/lib/isChinese.d.ts +4 -0
- package/lib/isChinese.js +10 -0
- package/lib/isNativeFunction.d.ts +5 -0
- package/lib/isNativeFunction.js +12 -0
- package/lib/listGenerator.d.ts +5 -0
- package/lib/listGenerator.js +11 -0
- package/lib/requestFullScreen.d.ts +6 -0
- package/lib/requestFullScreen.js +31 -0
- package/package.json +1 -1
package/docs/modules.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
- [base64ToBlob](modules.md#base64toblob)
|
|
10
10
|
- [blobToBase64](modules.md#blobtobase64)
|
|
11
|
+
- [cached](modules.md#cached)
|
|
11
12
|
- [camelCase](modules.md#camelcase)
|
|
12
13
|
- [canvasToBlob](modules.md#canvastoblob)
|
|
13
14
|
- [capitalize](modules.md#capitalize)
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
- [debounce](modules.md#debounce)
|
|
20
21
|
- [downloadFile](modules.md#downloadfile)
|
|
21
22
|
- [each](modules.md#each)
|
|
23
|
+
- [exitFullscreen](modules.md#exitfullscreen)
|
|
22
24
|
- [filterBankCardNo](modules.md#filterbankcardno)
|
|
23
25
|
- [filterCRLF](modules.md#filtercrlf)
|
|
24
26
|
- [filterEmoji](modules.md#filteremoji)
|
|
@@ -35,27 +37,33 @@
|
|
|
35
37
|
- [getDayMillisecond](modules.md#getdaymillisecond)
|
|
36
38
|
- [getImageInfo](modules.md#getimageinfo)
|
|
37
39
|
- [getLocal](modules.md#getlocal)
|
|
40
|
+
- [getRandom](modules.md#getrandom)
|
|
38
41
|
- [getRandomColor](modules.md#getrandomcolor)
|
|
42
|
+
- [getRandomNumber](modules.md#getrandomnumber)
|
|
39
43
|
- [getVideoInfo](modules.md#getvideoinfo)
|
|
40
44
|
- [inBrowser](modules.md#inbrowser)
|
|
41
45
|
- [insertLink](modules.md#insertlink)
|
|
42
46
|
- [insertScript](modules.md#insertscript)
|
|
43
47
|
- [insertStyle](modules.md#insertstyle)
|
|
48
|
+
- [isAmount](modules.md#isamount)
|
|
44
49
|
- [isAndroid](modules.md#isandroid)
|
|
45
50
|
- [isArray](modules.md#isarray)
|
|
46
51
|
- [isBoolean](modules.md#isboolean)
|
|
52
|
+
- [isChinese](modules.md#ischinese)
|
|
47
53
|
- [isDate](modules.md#isdate)
|
|
48
54
|
- [isEmail](modules.md#isemail)
|
|
49
55
|
- [isEmpty](modules.md#isempty)
|
|
50
56
|
- [isEmptyObject](modules.md#isemptyobject)
|
|
51
57
|
- [isError](modules.md#iserror)
|
|
52
58
|
- [isFunction](modules.md#isfunction)
|
|
59
|
+
- [isIE](modules.md#isie)
|
|
53
60
|
- [isIOS](modules.md#isios)
|
|
54
61
|
- [isIdCard](modules.md#isidcard)
|
|
55
62
|
- [isJSONString](modules.md#isjsonstring)
|
|
56
63
|
- [isLan](modules.md#islan)
|
|
57
64
|
- [isLicenseCode](modules.md#islicensecode)
|
|
58
65
|
- [isMobile](modules.md#ismobile)
|
|
66
|
+
- [isNativeFunction](modules.md#isnativefunction)
|
|
59
67
|
- [isNull](modules.md#isnull)
|
|
60
68
|
- [isNumber](modules.md#isnumber)
|
|
61
69
|
- [isObject](modules.md#isobject)
|
|
@@ -65,9 +73,12 @@
|
|
|
65
73
|
- [isString](modules.md#isstring)
|
|
66
74
|
- [isURL](modules.md#isurl)
|
|
67
75
|
- [isUndefined](modules.md#isundefined)
|
|
76
|
+
- [isWeChat](modules.md#iswechat)
|
|
77
|
+
- [isWeChatMiniProgram](modules.md#iswechatminiprogram)
|
|
68
78
|
- [isWeixin](modules.md#isweixin)
|
|
69
79
|
- [isWindow](modules.md#iswindow)
|
|
70
80
|
- [kebabCase](modules.md#kebabcase)
|
|
81
|
+
- [listGenerator](modules.md#listgenerator)
|
|
71
82
|
- [mousewheel](modules.md#mousewheel)
|
|
72
83
|
- [normalizePath](modules.md#normalizepath)
|
|
73
84
|
- [omit](modules.md#omit)
|
|
@@ -80,14 +91,18 @@
|
|
|
80
91
|
- [pascalCase](modules.md#pascalcase)
|
|
81
92
|
- [pick](modules.md#pick)
|
|
82
93
|
- [replaceCrlf](modules.md#replacecrlf)
|
|
94
|
+
- [requestFullScreen](modules.md#requestfullscreen)
|
|
83
95
|
- [reserve](modules.md#reserve)
|
|
84
96
|
- [rgbToHex](modules.md#rgbtohex)
|
|
85
97
|
- [round](modules.md#round)
|
|
98
|
+
- [scrollToTop](modules.md#scrolltotop)
|
|
86
99
|
- [sleep](modules.md#sleep)
|
|
87
100
|
- [splitArray](modules.md#splitarray)
|
|
88
101
|
- [stringTrim](modules.md#stringtrim)
|
|
89
102
|
- [stringifyQuery](modules.md#stringifyquery)
|
|
90
103
|
- [throttle](modules.md#throttle)
|
|
104
|
+
- [toCDB](modules.md#tocdb)
|
|
105
|
+
- [toDBC](modules.md#todbc)
|
|
91
106
|
- [typeOf](modules.md#typeof)
|
|
92
107
|
|
|
93
108
|
## Functions
|
|
@@ -111,7 +126,7 @@ base64 转 blob
|
|
|
111
126
|
|
|
112
127
|
#### Defined in
|
|
113
128
|
|
|
114
|
-
[base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/
|
|
129
|
+
[base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/base64ToBlob.ts#L6)
|
|
115
130
|
|
|
116
131
|
___
|
|
117
132
|
|
|
@@ -133,7 +148,48 @@ blob 转 base64
|
|
|
133
148
|
|
|
134
149
|
#### Defined in
|
|
135
150
|
|
|
136
|
-
[blobToBase64.ts:4](https://github.com/daysnap/utils/blob/
|
|
151
|
+
[blobToBase64.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/blobToBase64.ts#L4)
|
|
152
|
+
|
|
153
|
+
___
|
|
154
|
+
|
|
155
|
+
### cached
|
|
156
|
+
|
|
157
|
+
▸ **cached**<`T`\>(`fn`): (...`args`: `Parameters`<`T`\>) => `ReturnType`<`T`\>
|
|
158
|
+
|
|
159
|
+
缓存、记忆函数,缓存函数的运算结果
|
|
160
|
+
需注意缓存的函数得是纯函数
|
|
161
|
+
|
|
162
|
+
#### Type parameters
|
|
163
|
+
|
|
164
|
+
| Name | Type |
|
|
165
|
+
| :------ | :------ |
|
|
166
|
+
| `T` | extends (...`args`: `any`[]) => `any` |
|
|
167
|
+
|
|
168
|
+
#### Parameters
|
|
169
|
+
|
|
170
|
+
| Name | Type |
|
|
171
|
+
| :------ | :------ |
|
|
172
|
+
| `fn` | `T` |
|
|
173
|
+
|
|
174
|
+
#### Returns
|
|
175
|
+
|
|
176
|
+
`fn`
|
|
177
|
+
|
|
178
|
+
▸ (`...args`): `ReturnType`<`T`\>
|
|
179
|
+
|
|
180
|
+
##### Parameters
|
|
181
|
+
|
|
182
|
+
| Name | Type |
|
|
183
|
+
| :------ | :------ |
|
|
184
|
+
| `...args` | `Parameters`<`T`\> |
|
|
185
|
+
|
|
186
|
+
##### Returns
|
|
187
|
+
|
|
188
|
+
`ReturnType`<`T`\>
|
|
189
|
+
|
|
190
|
+
#### Defined in
|
|
191
|
+
|
|
192
|
+
[cached.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/cached.ts#L5)
|
|
137
193
|
|
|
138
194
|
___
|
|
139
195
|
|
|
@@ -156,7 +212,7 @@ camelCase('hello-world') => helloWorld
|
|
|
156
212
|
|
|
157
213
|
#### Defined in
|
|
158
214
|
|
|
159
|
-
[camelCase.ts:5](https://github.com/daysnap/utils/blob/
|
|
215
|
+
[camelCase.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/camelCase.ts#L5)
|
|
160
216
|
|
|
161
217
|
___
|
|
162
218
|
|
|
@@ -180,7 +236,7 @@ canvas 转 blob 文件
|
|
|
180
236
|
|
|
181
237
|
#### Defined in
|
|
182
238
|
|
|
183
|
-
[canvasToBlob.ts:4](https://github.com/daysnap/utils/blob/
|
|
239
|
+
[canvasToBlob.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/canvasToBlob.ts#L4)
|
|
184
240
|
|
|
185
241
|
___
|
|
186
242
|
|
|
@@ -203,7 +259,7 @@ capitalize('hello world') => Hello world
|
|
|
203
259
|
|
|
204
260
|
#### Defined in
|
|
205
261
|
|
|
206
|
-
[capitalize.ts:5](https://github.com/daysnap/utils/blob/
|
|
262
|
+
[capitalize.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/capitalize.ts#L5)
|
|
207
263
|
|
|
208
264
|
___
|
|
209
265
|
|
|
@@ -231,7 +287,7 @@ ___
|
|
|
231
287
|
|
|
232
288
|
#### Defined in
|
|
233
289
|
|
|
234
|
-
[clone.ts:8](https://github.com/daysnap/utils/blob/
|
|
290
|
+
[clone.ts:8](https://github.com/daysnap/utils/blob/71e90a2/src/clone.ts#L8)
|
|
235
291
|
|
|
236
292
|
___
|
|
237
293
|
|
|
@@ -259,7 +315,7 @@ ___
|
|
|
259
315
|
|
|
260
316
|
#### Defined in
|
|
261
317
|
|
|
262
|
-
[cloneSimple.ts:7](https://github.com/daysnap/utils/blob/
|
|
318
|
+
[cloneSimple.ts:7](https://github.com/daysnap/utils/blob/71e90a2/src/cloneSimple.ts#L7)
|
|
263
319
|
|
|
264
320
|
___
|
|
265
321
|
|
|
@@ -281,7 +337,7 @@ ___
|
|
|
281
337
|
|
|
282
338
|
#### Defined in
|
|
283
339
|
|
|
284
|
-
[createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/
|
|
340
|
+
[createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/createHexColorByHash.ts#L4)
|
|
285
341
|
|
|
286
342
|
___
|
|
287
343
|
|
|
@@ -307,7 +363,7 @@ ___
|
|
|
307
363
|
|
|
308
364
|
#### Defined in
|
|
309
365
|
|
|
310
|
-
[compareVersion.ts:9](https://github.com/daysnap/utils/blob/
|
|
366
|
+
[compareVersion.ts:9](https://github.com/daysnap/utils/blob/71e90a2/src/compareVersion.ts#L9)
|
|
311
367
|
|
|
312
368
|
___
|
|
313
369
|
|
|
@@ -329,7 +385,7 @@ ___
|
|
|
329
385
|
|
|
330
386
|
#### Defined in
|
|
331
387
|
|
|
332
|
-
[compressImage.ts:6](https://github.com/daysnap/utils/blob/
|
|
388
|
+
[compressImage.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/compressImage.ts#L6)
|
|
333
389
|
|
|
334
390
|
___
|
|
335
391
|
|
|
@@ -372,7 +428,7 @@ ___
|
|
|
372
428
|
|
|
373
429
|
#### Defined in
|
|
374
430
|
|
|
375
|
-
[debounce.ts:5](https://github.com/daysnap/utils/blob/
|
|
431
|
+
[debounce.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/debounce.ts#L5)
|
|
376
432
|
|
|
377
433
|
___
|
|
378
434
|
|
|
@@ -396,7 +452,7 @@ ___
|
|
|
396
452
|
|
|
397
453
|
#### Defined in
|
|
398
454
|
|
|
399
|
-
[downloadFile.ts:4](https://github.com/daysnap/utils/blob/
|
|
455
|
+
[downloadFile.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/downloadFile.ts#L4)
|
|
400
456
|
|
|
401
457
|
___
|
|
402
458
|
|
|
@@ -425,7 +481,7 @@ ___
|
|
|
425
481
|
|
|
426
482
|
#### Defined in
|
|
427
483
|
|
|
428
|
-
[each.ts:4](https://github.com/daysnap/utils/blob/
|
|
484
|
+
[each.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/each.ts#L4)
|
|
429
485
|
|
|
430
486
|
▸ **each**<`T`\>(`data`, `callback`): `void`
|
|
431
487
|
|
|
@@ -448,7 +504,25 @@ ___
|
|
|
448
504
|
|
|
449
505
|
#### Defined in
|
|
450
506
|
|
|
451
|
-
[each.ts:8](https://github.com/daysnap/utils/blob/
|
|
507
|
+
[each.ts:8](https://github.com/daysnap/utils/blob/71e90a2/src/each.ts#L8)
|
|
508
|
+
|
|
509
|
+
___
|
|
510
|
+
|
|
511
|
+
### exitFullscreen
|
|
512
|
+
|
|
513
|
+
▸ **exitFullscreen**(): `Promise`<`any`\>
|
|
514
|
+
|
|
515
|
+
退出全屏
|
|
516
|
+
成功则 resolve , 如果不支持退出全屏或退出失败则 rejected
|
|
517
|
+
[MDN Reference](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/exitFullscreen)
|
|
518
|
+
|
|
519
|
+
#### Returns
|
|
520
|
+
|
|
521
|
+
`Promise`<`any`\>
|
|
522
|
+
|
|
523
|
+
#### Defined in
|
|
524
|
+
|
|
525
|
+
[exitFullscreen.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/exitFullscreen.ts#L6)
|
|
452
526
|
|
|
453
527
|
___
|
|
454
528
|
|
|
@@ -470,7 +544,7 @@ ___
|
|
|
470
544
|
|
|
471
545
|
#### Defined in
|
|
472
546
|
|
|
473
|
-
[filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/
|
|
547
|
+
[filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/filterBankCardNo.ts#L4)
|
|
474
548
|
|
|
475
549
|
___
|
|
476
550
|
|
|
@@ -492,7 +566,7 @@ ___
|
|
|
492
566
|
|
|
493
567
|
#### Defined in
|
|
494
568
|
|
|
495
|
-
[filterCRLF.ts:4](https://github.com/daysnap/utils/blob/
|
|
569
|
+
[filterCRLF.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/filterCRLF.ts#L4)
|
|
496
570
|
|
|
497
571
|
___
|
|
498
572
|
|
|
@@ -514,7 +588,7 @@ ___
|
|
|
514
588
|
|
|
515
589
|
#### Defined in
|
|
516
590
|
|
|
517
|
-
[filterEmoji.ts:4](https://github.com/daysnap/utils/blob/
|
|
591
|
+
[filterEmoji.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/filterEmoji.ts#L4)
|
|
518
592
|
|
|
519
593
|
___
|
|
520
594
|
|
|
@@ -523,6 +597,7 @@ ___
|
|
|
523
597
|
▸ **filterIdCard**(`val`): `string`
|
|
524
598
|
|
|
525
599
|
身份证号码加 *
|
|
600
|
+
430421202312121234 => 430421********1234
|
|
526
601
|
|
|
527
602
|
#### Parameters
|
|
528
603
|
|
|
@@ -536,7 +611,7 @@ ___
|
|
|
536
611
|
|
|
537
612
|
#### Defined in
|
|
538
613
|
|
|
539
|
-
[filterIdCard.ts:
|
|
614
|
+
[filterIdCard.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/filterIdCard.ts#L5)
|
|
540
615
|
|
|
541
616
|
___
|
|
542
617
|
|
|
@@ -558,7 +633,7 @@ ___
|
|
|
558
633
|
|
|
559
634
|
#### Defined in
|
|
560
635
|
|
|
561
|
-
[filterName.ts:4](https://github.com/daysnap/utils/blob/
|
|
636
|
+
[filterName.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/filterName.ts#L4)
|
|
562
637
|
|
|
563
638
|
___
|
|
564
639
|
|
|
@@ -583,7 +658,7 @@ filterPhone('13177778888', ' ') => 131 **** 8888
|
|
|
583
658
|
|
|
584
659
|
#### Defined in
|
|
585
660
|
|
|
586
|
-
[filterPhone.ts:6](https://github.com/daysnap/utils/blob/
|
|
661
|
+
[filterPhone.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/filterPhone.ts#L6)
|
|
587
662
|
|
|
588
663
|
___
|
|
589
664
|
|
|
@@ -606,7 +681,7 @@ ___
|
|
|
606
681
|
|
|
607
682
|
#### Defined in
|
|
608
683
|
|
|
609
|
-
[formatAmount.ts:4](https://github.com/daysnap/utils/blob/
|
|
684
|
+
[formatAmount.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/formatAmount.ts#L4)
|
|
610
685
|
|
|
611
686
|
___
|
|
612
687
|
|
|
@@ -630,7 +705,7 @@ ___
|
|
|
630
705
|
|
|
631
706
|
#### Defined in
|
|
632
707
|
|
|
633
|
-
[formatDate.ts:8](https://github.com/daysnap/utils/blob/
|
|
708
|
+
[formatDate.ts:8](https://github.com/daysnap/utils/blob/71e90a2/src/formatDate.ts#L8)
|
|
634
709
|
|
|
635
710
|
___
|
|
636
711
|
|
|
@@ -639,6 +714,7 @@ ___
|
|
|
639
714
|
▸ **formatDateStr**(`v`): `Date`
|
|
640
715
|
|
|
641
716
|
str 转换成 date
|
|
717
|
+
fix iOS 日期时间格式如果是 - 就会报错的问题
|
|
642
718
|
|
|
643
719
|
#### Parameters
|
|
644
720
|
|
|
@@ -652,7 +728,7 @@ str 转换成 date
|
|
|
652
728
|
|
|
653
729
|
#### Defined in
|
|
654
730
|
|
|
655
|
-
[formatDateStr.ts:
|
|
731
|
+
[formatDateStr.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/formatDateStr.ts#L5)
|
|
656
732
|
|
|
657
733
|
___
|
|
658
734
|
|
|
@@ -677,7 +753,7 @@ formatMessage({ a: '123', b: { ba: '456' } }, ['b.ba']) => '456'
|
|
|
677
753
|
|
|
678
754
|
#### Defined in
|
|
679
755
|
|
|
680
|
-
[formatMessage.ts:11](https://github.com/daysnap/utils/blob/
|
|
756
|
+
[formatMessage.ts:11](https://github.com/daysnap/utils/blob/71e90a2/src/formatMessage.ts#L11)
|
|
681
757
|
|
|
682
758
|
___
|
|
683
759
|
|
|
@@ -709,7 +785,7 @@ rest = { xxx: 1 }
|
|
|
709
785
|
|
|
710
786
|
#### Defined in
|
|
711
787
|
|
|
712
|
-
[formatPathParams.ts:8](https://github.com/daysnap/utils/blob/
|
|
788
|
+
[formatPathParams.ts:8](https://github.com/daysnap/utils/blob/71e90a2/src/formatPathParams.ts#L8)
|
|
713
789
|
|
|
714
790
|
___
|
|
715
791
|
|
|
@@ -731,7 +807,7 @@ ___
|
|
|
731
807
|
|
|
732
808
|
#### Defined in
|
|
733
809
|
|
|
734
|
-
[getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/
|
|
810
|
+
[getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/getBlobByUrl.ts#L4)
|
|
735
811
|
|
|
736
812
|
___
|
|
737
813
|
|
|
@@ -754,7 +830,7 @@ ___
|
|
|
754
830
|
|
|
755
831
|
#### Defined in
|
|
756
832
|
|
|
757
|
-
[storage/index.ts:7](https://github.com/daysnap/utils/blob/
|
|
833
|
+
[storage/index.ts:7](https://github.com/daysnap/utils/blob/71e90a2/src/storage/index.ts#L7)
|
|
758
834
|
|
|
759
835
|
___
|
|
760
836
|
|
|
@@ -776,7 +852,7 @@ ___
|
|
|
776
852
|
|
|
777
853
|
#### Defined in
|
|
778
854
|
|
|
779
|
-
[getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/
|
|
855
|
+
[getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/getDayMillisecond.ts#L4)
|
|
780
856
|
|
|
781
857
|
___
|
|
782
858
|
|
|
@@ -798,7 +874,7 @@ ___
|
|
|
798
874
|
|
|
799
875
|
#### Defined in
|
|
800
876
|
|
|
801
|
-
[getImageInfo.ts:4](https://github.com/daysnap/utils/blob/
|
|
877
|
+
[getImageInfo.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/getImageInfo.ts#L4)
|
|
802
878
|
|
|
803
879
|
___
|
|
804
880
|
|
|
@@ -821,7 +897,30 @@ ___
|
|
|
821
897
|
|
|
822
898
|
#### Defined in
|
|
823
899
|
|
|
824
|
-
[storage/index.ts:7](https://github.com/daysnap/utils/blob/
|
|
900
|
+
[storage/index.ts:7](https://github.com/daysnap/utils/blob/71e90a2/src/storage/index.ts#L7)
|
|
901
|
+
|
|
902
|
+
___
|
|
903
|
+
|
|
904
|
+
### getRandom
|
|
905
|
+
|
|
906
|
+
▸ **getRandom**(`length`, `alphabet?`): `string`
|
|
907
|
+
|
|
908
|
+
生成一个随机字符串
|
|
909
|
+
|
|
910
|
+
#### Parameters
|
|
911
|
+
|
|
912
|
+
| Name | Type | Default value | Description |
|
|
913
|
+
| :------ | :------ | :------ | :------ |
|
|
914
|
+
| `length` | `number` | `undefined` | 生成随机字符串的长度 |
|
|
915
|
+
| `alphabet` | `string` | `'1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM'` | 字母表 |
|
|
916
|
+
|
|
917
|
+
#### Returns
|
|
918
|
+
|
|
919
|
+
`string`
|
|
920
|
+
|
|
921
|
+
#### Defined in
|
|
922
|
+
|
|
923
|
+
[getRandom.ts:7](https://github.com/daysnap/utils/blob/71e90a2/src/getRandom.ts#L7)
|
|
825
924
|
|
|
826
925
|
___
|
|
827
926
|
|
|
@@ -837,7 +936,29 @@ ___
|
|
|
837
936
|
|
|
838
937
|
#### Defined in
|
|
839
938
|
|
|
840
|
-
[getRandomColor.ts:4](https://github.com/daysnap/utils/blob/
|
|
939
|
+
[getRandomColor.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/getRandomColor.ts#L4)
|
|
940
|
+
|
|
941
|
+
___
|
|
942
|
+
|
|
943
|
+
### getRandomNumber
|
|
944
|
+
|
|
945
|
+
▸ **getRandomNumber**(`length`): `string`
|
|
946
|
+
|
|
947
|
+
生成一个随机数字
|
|
948
|
+
|
|
949
|
+
#### Parameters
|
|
950
|
+
|
|
951
|
+
| Name | Type | Description |
|
|
952
|
+
| :------ | :------ | :------ |
|
|
953
|
+
| `length` | `number` | 生成一个随机数字的长度 |
|
|
954
|
+
|
|
955
|
+
#### Returns
|
|
956
|
+
|
|
957
|
+
`string`
|
|
958
|
+
|
|
959
|
+
#### Defined in
|
|
960
|
+
|
|
961
|
+
[getRandomNumber.ts:7](https://github.com/daysnap/utils/blob/71e90a2/src/getRandomNumber.ts#L7)
|
|
841
962
|
|
|
842
963
|
___
|
|
843
964
|
|
|
@@ -859,7 +980,7 @@ ___
|
|
|
859
980
|
|
|
860
981
|
#### Defined in
|
|
861
982
|
|
|
862
|
-
[getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/
|
|
983
|
+
[getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/getVideoInfo.ts#L4)
|
|
863
984
|
|
|
864
985
|
___
|
|
865
986
|
|
|
@@ -875,7 +996,7 @@ ___
|
|
|
875
996
|
|
|
876
997
|
#### Defined in
|
|
877
998
|
|
|
878
|
-
[inBrowser.ts:4](https://github.com/daysnap/utils/blob/
|
|
999
|
+
[inBrowser.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/inBrowser.ts#L4)
|
|
879
1000
|
|
|
880
1001
|
___
|
|
881
1002
|
|
|
@@ -897,7 +1018,7 @@ ___
|
|
|
897
1018
|
|
|
898
1019
|
#### Defined in
|
|
899
1020
|
|
|
900
|
-
[insertLink.ts:4](https://github.com/daysnap/utils/blob/
|
|
1021
|
+
[insertLink.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/insertLink.ts#L4)
|
|
901
1022
|
|
|
902
1023
|
▸ **insertLink**(`href`, `callback`): `void`
|
|
903
1024
|
|
|
@@ -914,7 +1035,7 @@ ___
|
|
|
914
1035
|
|
|
915
1036
|
#### Defined in
|
|
916
1037
|
|
|
917
|
-
[insertLink.ts:5](https://github.com/daysnap/utils/blob/
|
|
1038
|
+
[insertLink.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/insertLink.ts#L5)
|
|
918
1039
|
|
|
919
1040
|
___
|
|
920
1041
|
|
|
@@ -936,7 +1057,7 @@ ___
|
|
|
936
1057
|
|
|
937
1058
|
#### Defined in
|
|
938
1059
|
|
|
939
|
-
[insertScript.ts:4](https://github.com/daysnap/utils/blob/
|
|
1060
|
+
[insertScript.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/insertScript.ts#L4)
|
|
940
1061
|
|
|
941
1062
|
▸ **insertScript**(`src`, `callback`): `void`
|
|
942
1063
|
|
|
@@ -953,7 +1074,7 @@ ___
|
|
|
953
1074
|
|
|
954
1075
|
#### Defined in
|
|
955
1076
|
|
|
956
|
-
[insertScript.ts:5](https://github.com/daysnap/utils/blob/
|
|
1077
|
+
[insertScript.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/insertScript.ts#L5)
|
|
957
1078
|
|
|
958
1079
|
___
|
|
959
1080
|
|
|
@@ -975,7 +1096,36 @@ ___
|
|
|
975
1096
|
|
|
976
1097
|
#### Defined in
|
|
977
1098
|
|
|
978
|
-
[insertStyle.ts:4](https://github.com/daysnap/utils/blob/
|
|
1099
|
+
[insertStyle.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/insertStyle.ts#L4)
|
|
1100
|
+
|
|
1101
|
+
___
|
|
1102
|
+
|
|
1103
|
+
### isAmount
|
|
1104
|
+
|
|
1105
|
+
▸ **isAmount**(`val`): `boolean`
|
|
1106
|
+
|
|
1107
|
+
判断是否是合法金额
|
|
1108
|
+
只能是数字,小数点后只能保留两位或一位
|
|
1109
|
+
isAmount(0) => true
|
|
1110
|
+
isAmount('01') => false
|
|
1111
|
+
isAmount('1.') => true
|
|
1112
|
+
isAmount('1.1') => true
|
|
1113
|
+
isAmount('1.12') => true
|
|
1114
|
+
isAmount('1.123') => false
|
|
1115
|
+
|
|
1116
|
+
#### Parameters
|
|
1117
|
+
|
|
1118
|
+
| Name | Type |
|
|
1119
|
+
| :------ | :------ |
|
|
1120
|
+
| `val` | `string` |
|
|
1121
|
+
|
|
1122
|
+
#### Returns
|
|
1123
|
+
|
|
1124
|
+
`boolean`
|
|
1125
|
+
|
|
1126
|
+
#### Defined in
|
|
1127
|
+
|
|
1128
|
+
[isAmount.ts:11](https://github.com/daysnap/utils/blob/71e90a2/src/isAmount.ts#L11)
|
|
979
1129
|
|
|
980
1130
|
___
|
|
981
1131
|
|
|
@@ -991,7 +1141,7 @@ ___
|
|
|
991
1141
|
|
|
992
1142
|
#### Defined in
|
|
993
1143
|
|
|
994
|
-
[isAndroid.ts:4](https://github.com/daysnap/utils/blob/
|
|
1144
|
+
[isAndroid.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isAndroid.ts#L4)
|
|
995
1145
|
|
|
996
1146
|
___
|
|
997
1147
|
|
|
@@ -1015,7 +1165,7 @@ val is any[]
|
|
|
1015
1165
|
|
|
1016
1166
|
#### Defined in
|
|
1017
1167
|
|
|
1018
|
-
[isArray.ts:6](https://github.com/daysnap/utils/blob/
|
|
1168
|
+
[isArray.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/isArray.ts#L6)
|
|
1019
1169
|
|
|
1020
1170
|
___
|
|
1021
1171
|
|
|
@@ -1037,7 +1187,29 @@ val is boolean
|
|
|
1037
1187
|
|
|
1038
1188
|
#### Defined in
|
|
1039
1189
|
|
|
1040
|
-
[isBoolean.ts:5](https://github.com/daysnap/utils/blob/
|
|
1190
|
+
[isBoolean.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/isBoolean.ts#L5)
|
|
1191
|
+
|
|
1192
|
+
___
|
|
1193
|
+
|
|
1194
|
+
### isChinese
|
|
1195
|
+
|
|
1196
|
+
▸ **isChinese**(`val`): `boolean`
|
|
1197
|
+
|
|
1198
|
+
判断是否是中文
|
|
1199
|
+
|
|
1200
|
+
#### Parameters
|
|
1201
|
+
|
|
1202
|
+
| Name | Type |
|
|
1203
|
+
| :------ | :------ |
|
|
1204
|
+
| `val` | `string` |
|
|
1205
|
+
|
|
1206
|
+
#### Returns
|
|
1207
|
+
|
|
1208
|
+
`boolean`
|
|
1209
|
+
|
|
1210
|
+
#### Defined in
|
|
1211
|
+
|
|
1212
|
+
[isChinese.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isChinese.ts#L4)
|
|
1041
1213
|
|
|
1042
1214
|
___
|
|
1043
1215
|
|
|
@@ -1059,7 +1231,7 @@ val is Date
|
|
|
1059
1231
|
|
|
1060
1232
|
#### Defined in
|
|
1061
1233
|
|
|
1062
|
-
[isDate.ts:4](https://github.com/daysnap/utils/blob/
|
|
1234
|
+
[isDate.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isDate.ts#L4)
|
|
1063
1235
|
|
|
1064
1236
|
___
|
|
1065
1237
|
|
|
@@ -1081,7 +1253,7 @@ ___
|
|
|
1081
1253
|
|
|
1082
1254
|
#### Defined in
|
|
1083
1255
|
|
|
1084
|
-
[isEmail.ts:4](https://github.com/daysnap/utils/blob/
|
|
1256
|
+
[isEmail.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isEmail.ts#L4)
|
|
1085
1257
|
|
|
1086
1258
|
___
|
|
1087
1259
|
|
|
@@ -1103,13 +1275,13 @@ ___
|
|
|
1103
1275
|
|
|
1104
1276
|
#### Defined in
|
|
1105
1277
|
|
|
1106
|
-
[isEmpty.ts:6](https://github.com/daysnap/utils/blob/
|
|
1278
|
+
[isEmpty.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/isEmpty.ts#L6)
|
|
1107
1279
|
|
|
1108
1280
|
___
|
|
1109
1281
|
|
|
1110
1282
|
### isEmptyObject
|
|
1111
1283
|
|
|
1112
|
-
▸ **isEmptyObject**(`
|
|
1284
|
+
▸ **isEmptyObject**(`val`): `boolean`
|
|
1113
1285
|
|
|
1114
1286
|
判断是否是空对象
|
|
1115
1287
|
|
|
@@ -1117,7 +1289,7 @@ ___
|
|
|
1117
1289
|
|
|
1118
1290
|
| Name | Type | Description |
|
|
1119
1291
|
| :------ | :------ | :------ |
|
|
1120
|
-
| `
|
|
1292
|
+
| `val` | `object` | 对象 |
|
|
1121
1293
|
|
|
1122
1294
|
#### Returns
|
|
1123
1295
|
|
|
@@ -1125,7 +1297,7 @@ ___
|
|
|
1125
1297
|
|
|
1126
1298
|
#### Defined in
|
|
1127
1299
|
|
|
1128
|
-
[isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/
|
|
1300
|
+
[isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/isEmptyObject.ts#L5)
|
|
1129
1301
|
|
|
1130
1302
|
___
|
|
1131
1303
|
|
|
@@ -1147,7 +1319,7 @@ val is Error
|
|
|
1147
1319
|
|
|
1148
1320
|
#### Defined in
|
|
1149
1321
|
|
|
1150
|
-
[isError.ts:4](https://github.com/daysnap/utils/blob/
|
|
1322
|
+
[isError.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isError.ts#L4)
|
|
1151
1323
|
|
|
1152
1324
|
___
|
|
1153
1325
|
|
|
@@ -1169,7 +1341,25 @@ val is Function
|
|
|
1169
1341
|
|
|
1170
1342
|
#### Defined in
|
|
1171
1343
|
|
|
1172
|
-
[isFunction.ts:4](https://github.com/daysnap/utils/blob/
|
|
1344
|
+
[isFunction.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isFunction.ts#L4)
|
|
1345
|
+
|
|
1346
|
+
___
|
|
1347
|
+
|
|
1348
|
+
### isIE
|
|
1349
|
+
|
|
1350
|
+
▸ **isIE**(): ``false`` \| `number`
|
|
1351
|
+
|
|
1352
|
+
判断浏览器是否是 ie
|
|
1353
|
+
如果是 ie 则会返回对应 ie 版本
|
|
1354
|
+
如果不是则返回false
|
|
1355
|
+
|
|
1356
|
+
#### Returns
|
|
1357
|
+
|
|
1358
|
+
``false`` \| `number`
|
|
1359
|
+
|
|
1360
|
+
#### Defined in
|
|
1361
|
+
|
|
1362
|
+
[isIE.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/isIE.ts#L6)
|
|
1173
1363
|
|
|
1174
1364
|
___
|
|
1175
1365
|
|
|
@@ -1185,7 +1375,7 @@ ___
|
|
|
1185
1375
|
|
|
1186
1376
|
#### Defined in
|
|
1187
1377
|
|
|
1188
|
-
[isIOS.ts:4](https://github.com/daysnap/utils/blob/
|
|
1378
|
+
[isIOS.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isIOS.ts#L4)
|
|
1189
1379
|
|
|
1190
1380
|
___
|
|
1191
1381
|
|
|
@@ -1207,7 +1397,7 @@ ___
|
|
|
1207
1397
|
|
|
1208
1398
|
#### Defined in
|
|
1209
1399
|
|
|
1210
|
-
[isIdCard.ts:4](https://github.com/daysnap/utils/blob/
|
|
1400
|
+
[isIdCard.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isIdCard.ts#L4)
|
|
1211
1401
|
|
|
1212
1402
|
___
|
|
1213
1403
|
|
|
@@ -1229,7 +1419,7 @@ ___
|
|
|
1229
1419
|
|
|
1230
1420
|
#### Defined in
|
|
1231
1421
|
|
|
1232
|
-
[isJSONString.ts:7](https://github.com/daysnap/utils/blob/
|
|
1422
|
+
[isJSONString.ts:7](https://github.com/daysnap/utils/blob/71e90a2/src/isJSONString.ts#L7)
|
|
1233
1423
|
|
|
1234
1424
|
___
|
|
1235
1425
|
|
|
@@ -1251,7 +1441,7 @@ ___
|
|
|
1251
1441
|
|
|
1252
1442
|
#### Defined in
|
|
1253
1443
|
|
|
1254
|
-
[isLan.ts:5](https://github.com/daysnap/utils/blob/
|
|
1444
|
+
[isLan.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/isLan.ts#L5)
|
|
1255
1445
|
|
|
1256
1446
|
___
|
|
1257
1447
|
|
|
@@ -1273,7 +1463,7 @@ ___
|
|
|
1273
1463
|
|
|
1274
1464
|
#### Defined in
|
|
1275
1465
|
|
|
1276
|
-
[isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/
|
|
1466
|
+
[isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/isLicenseCode.ts#L5)
|
|
1277
1467
|
|
|
1278
1468
|
___
|
|
1279
1469
|
|
|
@@ -1289,7 +1479,30 @@ ___
|
|
|
1289
1479
|
|
|
1290
1480
|
#### Defined in
|
|
1291
1481
|
|
|
1292
|
-
[isMobile.ts:4](https://github.com/daysnap/utils/blob/
|
|
1482
|
+
[isMobile.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isMobile.ts#L4)
|
|
1483
|
+
|
|
1484
|
+
___
|
|
1485
|
+
|
|
1486
|
+
### isNativeFunction
|
|
1487
|
+
|
|
1488
|
+
▸ **isNativeFunction**(`val`): `boolean`
|
|
1489
|
+
|
|
1490
|
+
判断是不是内置函数
|
|
1491
|
+
内置函数toString后的主体代码块为 [native code]
|
|
1492
|
+
|
|
1493
|
+
#### Parameters
|
|
1494
|
+
|
|
1495
|
+
| Name | Type |
|
|
1496
|
+
| :------ | :------ |
|
|
1497
|
+
| `val` | `unknown` |
|
|
1498
|
+
|
|
1499
|
+
#### Returns
|
|
1500
|
+
|
|
1501
|
+
`boolean`
|
|
1502
|
+
|
|
1503
|
+
#### Defined in
|
|
1504
|
+
|
|
1505
|
+
[isNativeFunction.ts:7](https://github.com/daysnap/utils/blob/71e90a2/src/isNativeFunction.ts#L7)
|
|
1293
1506
|
|
|
1294
1507
|
___
|
|
1295
1508
|
|
|
@@ -1311,7 +1524,7 @@ val is null
|
|
|
1311
1524
|
|
|
1312
1525
|
#### Defined in
|
|
1313
1526
|
|
|
1314
|
-
[isNull.ts:4](https://github.com/daysnap/utils/blob/
|
|
1527
|
+
[isNull.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isNull.ts#L4)
|
|
1315
1528
|
|
|
1316
1529
|
___
|
|
1317
1530
|
|
|
@@ -1333,7 +1546,7 @@ val is number
|
|
|
1333
1546
|
|
|
1334
1547
|
#### Defined in
|
|
1335
1548
|
|
|
1336
|
-
[isNumber.ts:5](https://github.com/daysnap/utils/blob/
|
|
1549
|
+
[isNumber.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/isNumber.ts#L5)
|
|
1337
1550
|
|
|
1338
1551
|
___
|
|
1339
1552
|
|
|
@@ -1355,7 +1568,7 @@ val is Record<string, any\>
|
|
|
1355
1568
|
|
|
1356
1569
|
#### Defined in
|
|
1357
1570
|
|
|
1358
|
-
[isObject.ts:4](https://github.com/daysnap/utils/blob/
|
|
1571
|
+
[isObject.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isObject.ts#L4)
|
|
1359
1572
|
|
|
1360
1573
|
___
|
|
1361
1574
|
|
|
@@ -1377,7 +1590,7 @@ ___
|
|
|
1377
1590
|
|
|
1378
1591
|
#### Defined in
|
|
1379
1592
|
|
|
1380
|
-
[isPhone.ts:4](https://github.com/daysnap/utils/blob/
|
|
1593
|
+
[isPhone.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isPhone.ts#L4)
|
|
1381
1594
|
|
|
1382
1595
|
___
|
|
1383
1596
|
|
|
@@ -1405,7 +1618,7 @@ val is Promise<T\>
|
|
|
1405
1618
|
|
|
1406
1619
|
#### Defined in
|
|
1407
1620
|
|
|
1408
|
-
[isPromise.ts:4](https://github.com/daysnap/utils/blob/
|
|
1621
|
+
[isPromise.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isPromise.ts#L4)
|
|
1409
1622
|
|
|
1410
1623
|
___
|
|
1411
1624
|
|
|
@@ -1427,7 +1640,7 @@ val is RegExp
|
|
|
1427
1640
|
|
|
1428
1641
|
#### Defined in
|
|
1429
1642
|
|
|
1430
|
-
[isRegExp.ts:4](https://github.com/daysnap/utils/blob/
|
|
1643
|
+
[isRegExp.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isRegExp.ts#L4)
|
|
1431
1644
|
|
|
1432
1645
|
___
|
|
1433
1646
|
|
|
@@ -1449,7 +1662,7 @@ val is string
|
|
|
1449
1662
|
|
|
1450
1663
|
#### Defined in
|
|
1451
1664
|
|
|
1452
|
-
[isString.ts:4](https://github.com/daysnap/utils/blob/
|
|
1665
|
+
[isString.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isString.ts#L4)
|
|
1453
1666
|
|
|
1454
1667
|
___
|
|
1455
1668
|
|
|
@@ -1471,7 +1684,7 @@ ___
|
|
|
1471
1684
|
|
|
1472
1685
|
#### Defined in
|
|
1473
1686
|
|
|
1474
|
-
[isURL.ts:4](https://github.com/daysnap/utils/blob/
|
|
1687
|
+
[isURL.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isURL.ts#L4)
|
|
1475
1688
|
|
|
1476
1689
|
___
|
|
1477
1690
|
|
|
@@ -1493,7 +1706,40 @@ val is undefined
|
|
|
1493
1706
|
|
|
1494
1707
|
#### Defined in
|
|
1495
1708
|
|
|
1496
|
-
[isUndefined.ts:4](https://github.com/daysnap/utils/blob/
|
|
1709
|
+
[isUndefined.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isUndefined.ts#L4)
|
|
1710
|
+
|
|
1711
|
+
___
|
|
1712
|
+
|
|
1713
|
+
### isWeChat
|
|
1714
|
+
|
|
1715
|
+
▸ **isWeChat**(): `boolean`
|
|
1716
|
+
|
|
1717
|
+
判断是否是微信浏览器
|
|
1718
|
+
|
|
1719
|
+
#### Returns
|
|
1720
|
+
|
|
1721
|
+
`boolean`
|
|
1722
|
+
|
|
1723
|
+
#### Defined in
|
|
1724
|
+
|
|
1725
|
+
[isWeChat.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/isWeChat.ts#L4)
|
|
1726
|
+
|
|
1727
|
+
___
|
|
1728
|
+
|
|
1729
|
+
### isWeChatMiniProgram
|
|
1730
|
+
|
|
1731
|
+
▸ **isWeChatMiniProgram**(): `boolean`
|
|
1732
|
+
|
|
1733
|
+
判断是否是微信小程序web-view环境
|
|
1734
|
+
https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html
|
|
1735
|
+
|
|
1736
|
+
#### Returns
|
|
1737
|
+
|
|
1738
|
+
`boolean`
|
|
1739
|
+
|
|
1740
|
+
#### Defined in
|
|
1741
|
+
|
|
1742
|
+
[isWeChatMiniProgram.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/isWeChatMiniProgram.ts#L5)
|
|
1497
1743
|
|
|
1498
1744
|
___
|
|
1499
1745
|
|
|
@@ -1501,7 +1747,11 @@ ___
|
|
|
1501
1747
|
|
|
1502
1748
|
▸ **isWeixin**(): `boolean`
|
|
1503
1749
|
|
|
1504
|
-
|
|
1750
|
+
判断是否是微信浏览器
|
|
1751
|
+
|
|
1752
|
+
**`Deprecated`**
|
|
1753
|
+
|
|
1754
|
+
请使用 isWeChat 方法
|
|
1505
1755
|
|
|
1506
1756
|
#### Returns
|
|
1507
1757
|
|
|
@@ -1509,7 +1759,7 @@ ___
|
|
|
1509
1759
|
|
|
1510
1760
|
#### Defined in
|
|
1511
1761
|
|
|
1512
|
-
[
|
|
1762
|
+
[isWeChat.ts:12](https://github.com/daysnap/utils/blob/71e90a2/src/isWeChat.ts#L12)
|
|
1513
1763
|
|
|
1514
1764
|
___
|
|
1515
1765
|
|
|
@@ -1531,7 +1781,7 @@ val is Window
|
|
|
1531
1781
|
|
|
1532
1782
|
#### Defined in
|
|
1533
1783
|
|
|
1534
|
-
[isWindow.ts:5](https://github.com/daysnap/utils/blob/
|
|
1784
|
+
[isWindow.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/isWindow.ts#L5)
|
|
1535
1785
|
|
|
1536
1786
|
___
|
|
1537
1787
|
|
|
@@ -1554,7 +1804,36 @@ kebabCase('helloWorld') => hello-world
|
|
|
1554
1804
|
|
|
1555
1805
|
#### Defined in
|
|
1556
1806
|
|
|
1557
|
-
[kebabCase.ts:5](https://github.com/daysnap/utils/blob/
|
|
1807
|
+
[kebabCase.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/kebabCase.ts#L5)
|
|
1808
|
+
|
|
1809
|
+
___
|
|
1810
|
+
|
|
1811
|
+
### listGenerator
|
|
1812
|
+
|
|
1813
|
+
▸ **listGenerator**<`T`\>(`length`, `fn`): `T`[]
|
|
1814
|
+
|
|
1815
|
+
list 生成器,快速生成数据
|
|
1816
|
+
|
|
1817
|
+
#### Type parameters
|
|
1818
|
+
|
|
1819
|
+
| Name | Type |
|
|
1820
|
+
| :------ | :------ |
|
|
1821
|
+
| `T` | `any` |
|
|
1822
|
+
|
|
1823
|
+
#### Parameters
|
|
1824
|
+
|
|
1825
|
+
| Name | Type | Description |
|
|
1826
|
+
| :------ | :------ | :------ |
|
|
1827
|
+
| `length` | `number` | 个数 |
|
|
1828
|
+
| `fn` | (`index`: `number`) => `T` | - |
|
|
1829
|
+
|
|
1830
|
+
#### Returns
|
|
1831
|
+
|
|
1832
|
+
`T`[]
|
|
1833
|
+
|
|
1834
|
+
#### Defined in
|
|
1835
|
+
|
|
1836
|
+
[listGenerator.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/listGenerator.ts#L5)
|
|
1558
1837
|
|
|
1559
1838
|
___
|
|
1560
1839
|
|
|
@@ -1579,7 +1858,7 @@ ___
|
|
|
1579
1858
|
|
|
1580
1859
|
#### Defined in
|
|
1581
1860
|
|
|
1582
|
-
[mousewheel.ts:22](https://github.com/daysnap/utils/blob/
|
|
1861
|
+
[mousewheel.ts:22](https://github.com/daysnap/utils/blob/71e90a2/src/mousewheel.ts#L22)
|
|
1583
1862
|
|
|
1584
1863
|
___
|
|
1585
1864
|
|
|
@@ -1601,7 +1880,7 @@ ___
|
|
|
1601
1880
|
|
|
1602
1881
|
#### Defined in
|
|
1603
1882
|
|
|
1604
|
-
[normalizePath.ts:4](https://github.com/daysnap/utils/blob/
|
|
1883
|
+
[normalizePath.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/normalizePath.ts#L4)
|
|
1605
1884
|
|
|
1606
1885
|
___
|
|
1607
1886
|
|
|
@@ -1631,7 +1910,7 @@ ___
|
|
|
1631
1910
|
|
|
1632
1911
|
#### Defined in
|
|
1633
1912
|
|
|
1634
|
-
[omit.ts:4](https://github.com/daysnap/utils/blob/
|
|
1913
|
+
[omit.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/omit.ts#L4)
|
|
1635
1914
|
|
|
1636
1915
|
___
|
|
1637
1916
|
|
|
@@ -1655,7 +1934,7 @@ ___
|
|
|
1655
1934
|
|
|
1656
1935
|
#### Defined in
|
|
1657
1936
|
|
|
1658
|
-
[padding.ts:7](https://github.com/daysnap/utils/blob/
|
|
1937
|
+
[padding.ts:7](https://github.com/daysnap/utils/blob/71e90a2/src/padding.ts#L7)
|
|
1659
1938
|
|
|
1660
1939
|
___
|
|
1661
1940
|
|
|
@@ -1677,7 +1956,7 @@ ___
|
|
|
1677
1956
|
|
|
1678
1957
|
#### Defined in
|
|
1679
1958
|
|
|
1680
|
-
[parseDate.ts:4](https://github.com/daysnap/utils/blob/
|
|
1959
|
+
[parseDate.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/parseDate.ts#L4)
|
|
1681
1960
|
|
|
1682
1961
|
___
|
|
1683
1962
|
|
|
@@ -1700,7 +1979,7 @@ ___
|
|
|
1700
1979
|
|
|
1701
1980
|
#### Defined in
|
|
1702
1981
|
|
|
1703
|
-
[parseError.ts:8](https://github.com/daysnap/utils/blob/
|
|
1982
|
+
[parseError.ts:8](https://github.com/daysnap/utils/blob/71e90a2/src/parseError.ts#L8)
|
|
1704
1983
|
|
|
1705
1984
|
___
|
|
1706
1985
|
|
|
@@ -1730,7 +2009,7 @@ parseObject('a.b.c', 1) => { a: { b: { c: 1 } } }
|
|
|
1730
2009
|
|
|
1731
2010
|
#### Defined in
|
|
1732
2011
|
|
|
1733
|
-
[parseObject.ts:5](https://github.com/daysnap/utils/blob/
|
|
2012
|
+
[parseObject.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/parseObject.ts#L5)
|
|
1734
2013
|
|
|
1735
2014
|
___
|
|
1736
2015
|
|
|
@@ -1759,7 +2038,7 @@ ___
|
|
|
1759
2038
|
|
|
1760
2039
|
#### Defined in
|
|
1761
2040
|
|
|
1762
|
-
[parsePath.ts:6](https://github.com/daysnap/utils/blob/
|
|
2041
|
+
[parsePath.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/parsePath.ts#L6)
|
|
1763
2042
|
|
|
1764
2043
|
___
|
|
1765
2044
|
|
|
@@ -1782,7 +2061,7 @@ ___
|
|
|
1782
2061
|
|
|
1783
2062
|
#### Defined in
|
|
1784
2063
|
|
|
1785
|
-
[parseQuery.ts:8](https://github.com/daysnap/utils/blob/
|
|
2064
|
+
[parseQuery.ts:8](https://github.com/daysnap/utils/blob/71e90a2/src/parseQuery.ts#L8)
|
|
1786
2065
|
|
|
1787
2066
|
___
|
|
1788
2067
|
|
|
@@ -1805,7 +2084,7 @@ pascalCase('hello-world') => HelloWorld
|
|
|
1805
2084
|
|
|
1806
2085
|
#### Defined in
|
|
1807
2086
|
|
|
1808
|
-
[pascalCase.ts:8](https://github.com/daysnap/utils/blob/
|
|
2087
|
+
[pascalCase.ts:8](https://github.com/daysnap/utils/blob/71e90a2/src/pascalCase.ts#L8)
|
|
1809
2088
|
|
|
1810
2089
|
___
|
|
1811
2090
|
|
|
@@ -1835,7 +2114,7 @@ ___
|
|
|
1835
2114
|
|
|
1836
2115
|
#### Defined in
|
|
1837
2116
|
|
|
1838
|
-
[pick.ts:4](https://github.com/daysnap/utils/blob/
|
|
2117
|
+
[pick.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/pick.ts#L4)
|
|
1839
2118
|
|
|
1840
2119
|
___
|
|
1841
2120
|
|
|
@@ -1858,7 +2137,31 @@ ___
|
|
|
1858
2137
|
|
|
1859
2138
|
#### Defined in
|
|
1860
2139
|
|
|
1861
|
-
[replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/
|
|
2140
|
+
[replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/replaceCrlf.ts#L4)
|
|
2141
|
+
|
|
2142
|
+
___
|
|
2143
|
+
|
|
2144
|
+
### requestFullScreen
|
|
2145
|
+
|
|
2146
|
+
▸ **requestFullScreen**(`ele?`): `Promise`<`any`\>
|
|
2147
|
+
|
|
2148
|
+
开启全屏
|
|
2149
|
+
成功则 resolve , 如果不支持全屏或开启失败则 rejected
|
|
2150
|
+
[MDN Reference] https://developer.mozilla.org/zh-CN/docs/Web/API/Element/requestFullscreen
|
|
2151
|
+
|
|
2152
|
+
#### Parameters
|
|
2153
|
+
|
|
2154
|
+
| Name | Type | Default value |
|
|
2155
|
+
| :------ | :------ | :------ |
|
|
2156
|
+
| `ele` | `HTMLElement` | `window.document.documentElement` |
|
|
2157
|
+
|
|
2158
|
+
#### Returns
|
|
2159
|
+
|
|
2160
|
+
`Promise`<`any`\>
|
|
2161
|
+
|
|
2162
|
+
#### Defined in
|
|
2163
|
+
|
|
2164
|
+
[requestFullScreen.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/requestFullScreen.ts#L6)
|
|
1862
2165
|
|
|
1863
2166
|
___
|
|
1864
2167
|
|
|
@@ -1884,7 +2187,7 @@ reserve(0, '--') => 0
|
|
|
1884
2187
|
|
|
1885
2188
|
#### Defined in
|
|
1886
2189
|
|
|
1887
|
-
[reserve.ts:8](https://github.com/daysnap/utils/blob/
|
|
2190
|
+
[reserve.ts:8](https://github.com/daysnap/utils/blob/71e90a2/src/reserve.ts#L8)
|
|
1888
2191
|
|
|
1889
2192
|
___
|
|
1890
2193
|
|
|
@@ -1908,7 +2211,7 @@ ___
|
|
|
1908
2211
|
|
|
1909
2212
|
#### Defined in
|
|
1910
2213
|
|
|
1911
|
-
[rgbToHex.ts:4](https://github.com/daysnap/utils/blob/
|
|
2214
|
+
[rgbToHex.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/rgbToHex.ts#L4)
|
|
1912
2215
|
|
|
1913
2216
|
___
|
|
1914
2217
|
|
|
@@ -1931,7 +2234,23 @@ ___
|
|
|
1931
2234
|
|
|
1932
2235
|
#### Defined in
|
|
1933
2236
|
|
|
1934
|
-
[round.ts:6](https://github.com/daysnap/utils/blob/
|
|
2237
|
+
[round.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/round.ts#L6)
|
|
2238
|
+
|
|
2239
|
+
___
|
|
2240
|
+
|
|
2241
|
+
### scrollToTop
|
|
2242
|
+
|
|
2243
|
+
▸ **scrollToTop**(): `void`
|
|
2244
|
+
|
|
2245
|
+
滚动到页面顶部
|
|
2246
|
+
|
|
2247
|
+
#### Returns
|
|
2248
|
+
|
|
2249
|
+
`void`
|
|
2250
|
+
|
|
2251
|
+
#### Defined in
|
|
2252
|
+
|
|
2253
|
+
[scrollToTop.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/scrollToTop.ts#L4)
|
|
1935
2254
|
|
|
1936
2255
|
___
|
|
1937
2256
|
|
|
@@ -1954,7 +2273,7 @@ ___
|
|
|
1954
2273
|
|
|
1955
2274
|
#### Defined in
|
|
1956
2275
|
|
|
1957
|
-
[sleep.ts:6](https://github.com/daysnap/utils/blob/
|
|
2276
|
+
[sleep.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/sleep.ts#L6)
|
|
1958
2277
|
|
|
1959
2278
|
___
|
|
1960
2279
|
|
|
@@ -1983,7 +2302,7 @@ ___
|
|
|
1983
2302
|
|
|
1984
2303
|
#### Defined in
|
|
1985
2304
|
|
|
1986
|
-
[splitArray.ts:4](https://github.com/daysnap/utils/blob/
|
|
2305
|
+
[splitArray.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/splitArray.ts#L4)
|
|
1987
2306
|
|
|
1988
2307
|
___
|
|
1989
2308
|
|
|
@@ -2006,7 +2325,7 @@ ___
|
|
|
2006
2325
|
|
|
2007
2326
|
#### Defined in
|
|
2008
2327
|
|
|
2009
|
-
[stringTrim.ts:6](https://github.com/daysnap/utils/blob/
|
|
2328
|
+
[stringTrim.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/stringTrim.ts#L6)
|
|
2010
2329
|
|
|
2011
2330
|
___
|
|
2012
2331
|
|
|
@@ -2014,7 +2333,7 @@ ___
|
|
|
2014
2333
|
|
|
2015
2334
|
▸ **stringifyQuery**(`v`): `string`
|
|
2016
2335
|
|
|
2017
|
-
|
|
2336
|
+
对象转 URLSearchParams
|
|
2018
2337
|
|
|
2019
2338
|
#### Parameters
|
|
2020
2339
|
|
|
@@ -2028,7 +2347,7 @@ ___
|
|
|
2028
2347
|
|
|
2029
2348
|
#### Defined in
|
|
2030
2349
|
|
|
2031
|
-
[stringifyQuery.ts:7](https://github.com/daysnap/utils/blob/
|
|
2350
|
+
[stringifyQuery.ts:7](https://github.com/daysnap/utils/blob/71e90a2/src/stringifyQuery.ts#L7)
|
|
2032
2351
|
|
|
2033
2352
|
___
|
|
2034
2353
|
|
|
@@ -2071,7 +2390,51 @@ ___
|
|
|
2071
2390
|
|
|
2072
2391
|
#### Defined in
|
|
2073
2392
|
|
|
2074
|
-
[throttle.ts:5](https://github.com/daysnap/utils/blob/
|
|
2393
|
+
[throttle.ts:5](https://github.com/daysnap/utils/blob/71e90a2/src/throttle.ts#L5)
|
|
2394
|
+
|
|
2395
|
+
___
|
|
2396
|
+
|
|
2397
|
+
### toCDB
|
|
2398
|
+
|
|
2399
|
+
▸ **toCDB**(`str`): `string`
|
|
2400
|
+
|
|
2401
|
+
全角转换为半角
|
|
2402
|
+
|
|
2403
|
+
#### Parameters
|
|
2404
|
+
|
|
2405
|
+
| Name | Type |
|
|
2406
|
+
| :------ | :------ |
|
|
2407
|
+
| `str` | `string` |
|
|
2408
|
+
|
|
2409
|
+
#### Returns
|
|
2410
|
+
|
|
2411
|
+
`string`
|
|
2412
|
+
|
|
2413
|
+
#### Defined in
|
|
2414
|
+
|
|
2415
|
+
[toCDB.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/toCDB.ts#L4)
|
|
2416
|
+
|
|
2417
|
+
___
|
|
2418
|
+
|
|
2419
|
+
### toDBC
|
|
2420
|
+
|
|
2421
|
+
▸ **toDBC**(`str`): `string`
|
|
2422
|
+
|
|
2423
|
+
半角转换为全角
|
|
2424
|
+
|
|
2425
|
+
#### Parameters
|
|
2426
|
+
|
|
2427
|
+
| Name | Type |
|
|
2428
|
+
| :------ | :------ |
|
|
2429
|
+
| `str` | `string` |
|
|
2430
|
+
|
|
2431
|
+
#### Returns
|
|
2432
|
+
|
|
2433
|
+
`string`
|
|
2434
|
+
|
|
2435
|
+
#### Defined in
|
|
2436
|
+
|
|
2437
|
+
[toDBC.ts:4](https://github.com/daysnap/utils/blob/71e90a2/src/toDBC.ts#L4)
|
|
2075
2438
|
|
|
2076
2439
|
___
|
|
2077
2440
|
|
|
@@ -2095,4 +2458,4 @@ ___
|
|
|
2095
2458
|
|
|
2096
2459
|
#### Defined in
|
|
2097
2460
|
|
|
2098
|
-
[typeOf.ts:6](https://github.com/daysnap/utils/blob/
|
|
2461
|
+
[typeOf.ts:6](https://github.com/daysnap/utils/blob/71e90a2/src/typeOf.ts#L6)
|