@daysnap/utils 0.0.35 → 0.0.37
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/docs/modules.md +273 -56
- package/es/filterCRLF.d.ts +4 -0
- package/es/filterCRLF.js +6 -0
- package/es/getBlobByUrl.js +1 -0
- package/es/getRandomColor.d.ts +4 -0
- package/es/getRandomColor.js +6 -0
- package/es/index.d.ts +9 -0
- package/es/index.js +10 -1
- package/es/isArray.d.ts +6 -0
- package/es/isArray.js +8 -0
- package/es/isWeixin.d.ts +4 -0
- package/es/isWeixin.js +6 -0
- package/es/loadResource.d.ts +7 -0
- package/es/loadResource.js +31 -0
- package/es/padding.d.ts +7 -0
- package/es/padding.js +11 -0
- package/es/parseObject.d.ts +4 -0
- package/es/parseObject.js +12 -0
- package/es/stringTrim.d.ts +4 -0
- package/es/stringTrim.js +21 -0
- package/es/typeOf.d.ts +6 -0
- package/es/typeOf.js +8 -0
- package/lib/filterCRLF.d.ts +4 -0
- package/lib/filterCRLF.js +12 -0
- package/lib/getBlobByUrl.js +1 -0
- package/lib/getRandomColor.d.ts +4 -0
- package/lib/getRandomColor.js +12 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +99 -0
- package/lib/isArray.d.ts +6 -0
- package/lib/isArray.js +14 -0
- package/lib/isWeixin.d.ts +4 -0
- package/lib/isWeixin.js +12 -0
- package/lib/loadResource.d.ts +7 -0
- package/lib/loadResource.js +37 -0
- package/lib/padding.d.ts +7 -0
- package/lib/padding.js +17 -0
- package/lib/parseObject.d.ts +4 -0
- package/lib/parseObject.js +18 -0
- package/lib/stringTrim.d.ts +4 -0
- package/lib/stringTrim.js +27 -0
- package/lib/typeOf.d.ts +6 -0
- package/lib/typeOf.js +14 -0
- package/package.json +1 -1
package/docs/modules.md
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
- [downloadFile](modules.md#downloadfile)
|
|
16
16
|
- [each](modules.md#each)
|
|
17
17
|
- [filterBankCardNo](modules.md#filterbankcardno)
|
|
18
|
+
- [filterCRLF](modules.md#filtercrlf)
|
|
18
19
|
- [filterEmoji](modules.md#filteremoji)
|
|
19
20
|
- [filterIdCard](modules.md#filteridcard)
|
|
20
21
|
- [filterName](modules.md#filtername)
|
|
@@ -26,9 +27,11 @@
|
|
|
26
27
|
- [getDayMillisecond](modules.md#getdaymillisecond)
|
|
27
28
|
- [getImageInfo](modules.md#getimageinfo)
|
|
28
29
|
- [getLocal](modules.md#getlocal)
|
|
30
|
+
- [getRandomColor](modules.md#getrandomcolor)
|
|
29
31
|
- [getVideoInfo](modules.md#getvideoinfo)
|
|
30
32
|
- [inBrowser](modules.md#inbrowser)
|
|
31
33
|
- [isAndroid](modules.md#isandroid)
|
|
34
|
+
- [isArray](modules.md#isarray)
|
|
32
35
|
- [isBoolean](modules.md#isboolean)
|
|
33
36
|
- [isEmail](modules.md#isemail)
|
|
34
37
|
- [isEmpty](modules.md#isempty)
|
|
@@ -49,10 +52,14 @@
|
|
|
49
52
|
- [isRegExp](modules.md#isregexp)
|
|
50
53
|
- [isString](modules.md#isstring)
|
|
51
54
|
- [isUndefined](modules.md#isundefined)
|
|
55
|
+
- [isWeixin](modules.md#isweixin)
|
|
52
56
|
- [isWindow](modules.md#iswindow)
|
|
57
|
+
- [loadResource](modules.md#loadresource)
|
|
53
58
|
- [omit](modules.md#omit)
|
|
59
|
+
- [padding](modules.md#padding)
|
|
54
60
|
- [parseDate](modules.md#parsedate)
|
|
55
61
|
- [parseError](modules.md#parseerror)
|
|
62
|
+
- [parseObject](modules.md#parseobject)
|
|
56
63
|
- [parsePath](modules.md#parsepath)
|
|
57
64
|
- [parseQuery](modules.md#parsequery)
|
|
58
65
|
- [pick](modules.md#pick)
|
|
@@ -60,7 +67,9 @@
|
|
|
60
67
|
- [reserve](modules.md#reserve)
|
|
61
68
|
- [round](modules.md#round)
|
|
62
69
|
- [sleep](modules.md#sleep)
|
|
70
|
+
- [stringTrim](modules.md#stringtrim)
|
|
63
71
|
- [stringifyQuery](modules.md#stringifyquery)
|
|
72
|
+
- [typeOf](modules.md#typeof)
|
|
64
73
|
|
|
65
74
|
## Functions
|
|
66
75
|
|
|
@@ -83,7 +92,7 @@ base64 转 blob
|
|
|
83
92
|
|
|
84
93
|
#### Defined in
|
|
85
94
|
|
|
86
|
-
[base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/
|
|
95
|
+
[base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/eba3391/src/base64ToBlob.ts#L6)
|
|
87
96
|
|
|
88
97
|
___
|
|
89
98
|
|
|
@@ -105,7 +114,7 @@ blob 转 base64
|
|
|
105
114
|
|
|
106
115
|
#### Defined in
|
|
107
116
|
|
|
108
|
-
[blobToBase64.ts:4](https://github.com/daysnap/utils/blob/
|
|
117
|
+
[blobToBase64.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/blobToBase64.ts#L4)
|
|
109
118
|
|
|
110
119
|
___
|
|
111
120
|
|
|
@@ -133,7 +142,7 @@ ___
|
|
|
133
142
|
|
|
134
143
|
#### Defined in
|
|
135
144
|
|
|
136
|
-
[clone.ts:7](https://github.com/daysnap/utils/blob/
|
|
145
|
+
[clone.ts:7](https://github.com/daysnap/utils/blob/eba3391/src/clone.ts#L7)
|
|
137
146
|
|
|
138
147
|
___
|
|
139
148
|
|
|
@@ -155,7 +164,7 @@ ___
|
|
|
155
164
|
|
|
156
165
|
#### Defined in
|
|
157
166
|
|
|
158
|
-
[createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/
|
|
167
|
+
[createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/createHexColorByHash.ts#L4)
|
|
159
168
|
|
|
160
169
|
___
|
|
161
170
|
|
|
@@ -181,7 +190,7 @@ ___
|
|
|
181
190
|
|
|
182
191
|
#### Defined in
|
|
183
192
|
|
|
184
|
-
[compareVersion.ts:9](https://github.com/daysnap/utils/blob/
|
|
193
|
+
[compareVersion.ts:9](https://github.com/daysnap/utils/blob/eba3391/src/compareVersion.ts#L9)
|
|
185
194
|
|
|
186
195
|
___
|
|
187
196
|
|
|
@@ -203,7 +212,7 @@ ___
|
|
|
203
212
|
|
|
204
213
|
#### Defined in
|
|
205
214
|
|
|
206
|
-
[compressImage.ts:6](https://github.com/daysnap/utils/blob/
|
|
215
|
+
[compressImage.ts:6](https://github.com/daysnap/utils/blob/eba3391/src/compressImage.ts#L6)
|
|
207
216
|
|
|
208
217
|
___
|
|
209
218
|
|
|
@@ -227,7 +236,7 @@ ___
|
|
|
227
236
|
|
|
228
237
|
#### Defined in
|
|
229
238
|
|
|
230
|
-
[downloadFile.ts:4](https://github.com/daysnap/utils/blob/
|
|
239
|
+
[downloadFile.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/downloadFile.ts#L4)
|
|
231
240
|
|
|
232
241
|
___
|
|
233
242
|
|
|
@@ -256,7 +265,7 @@ ___
|
|
|
256
265
|
|
|
257
266
|
#### Defined in
|
|
258
267
|
|
|
259
|
-
[each.ts:4](https://github.com/daysnap/utils/blob/
|
|
268
|
+
[each.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/each.ts#L4)
|
|
260
269
|
|
|
261
270
|
▸ **each**<`T`\>(`data`, `callback`): `void`
|
|
262
271
|
|
|
@@ -279,7 +288,7 @@ ___
|
|
|
279
288
|
|
|
280
289
|
#### Defined in
|
|
281
290
|
|
|
282
|
-
[each.ts:8](https://github.com/daysnap/utils/blob/
|
|
291
|
+
[each.ts:8](https://github.com/daysnap/utils/blob/eba3391/src/each.ts#L8)
|
|
283
292
|
|
|
284
293
|
___
|
|
285
294
|
|
|
@@ -301,7 +310,29 @@ ___
|
|
|
301
310
|
|
|
302
311
|
#### Defined in
|
|
303
312
|
|
|
304
|
-
[filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/
|
|
313
|
+
[filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/filterBankCardNo.ts#L4)
|
|
314
|
+
|
|
315
|
+
___
|
|
316
|
+
|
|
317
|
+
### filterCRLF
|
|
318
|
+
|
|
319
|
+
▸ **filterCRLF**(`v`): `string`
|
|
320
|
+
|
|
321
|
+
替换字符串里面的回车换行符
|
|
322
|
+
|
|
323
|
+
#### Parameters
|
|
324
|
+
|
|
325
|
+
| Name | Type |
|
|
326
|
+
| :------ | :------ |
|
|
327
|
+
| `v` | `string` |
|
|
328
|
+
|
|
329
|
+
#### Returns
|
|
330
|
+
|
|
331
|
+
`string`
|
|
332
|
+
|
|
333
|
+
#### Defined in
|
|
334
|
+
|
|
335
|
+
[filterCRLF.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/filterCRLF.ts#L4)
|
|
305
336
|
|
|
306
337
|
___
|
|
307
338
|
|
|
@@ -323,7 +354,7 @@ ___
|
|
|
323
354
|
|
|
324
355
|
#### Defined in
|
|
325
356
|
|
|
326
|
-
[filterEmoji.ts:4](https://github.com/daysnap/utils/blob/
|
|
357
|
+
[filterEmoji.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/filterEmoji.ts#L4)
|
|
327
358
|
|
|
328
359
|
___
|
|
329
360
|
|
|
@@ -345,7 +376,7 @@ ___
|
|
|
345
376
|
|
|
346
377
|
#### Defined in
|
|
347
378
|
|
|
348
|
-
[filterIdCard.ts:4](https://github.com/daysnap/utils/blob/
|
|
379
|
+
[filterIdCard.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/filterIdCard.ts#L4)
|
|
349
380
|
|
|
350
381
|
___
|
|
351
382
|
|
|
@@ -367,7 +398,7 @@ ___
|
|
|
367
398
|
|
|
368
399
|
#### Defined in
|
|
369
400
|
|
|
370
|
-
[filterName.ts:4](https://github.com/daysnap/utils/blob/
|
|
401
|
+
[filterName.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/filterName.ts#L4)
|
|
371
402
|
|
|
372
403
|
___
|
|
373
404
|
|
|
@@ -392,7 +423,7 @@ filterPhone('13177778888', ' ') => 131 **** 8888
|
|
|
392
423
|
|
|
393
424
|
#### Defined in
|
|
394
425
|
|
|
395
|
-
[filterPhone.ts:6](https://github.com/daysnap/utils/blob/
|
|
426
|
+
[filterPhone.ts:6](https://github.com/daysnap/utils/blob/eba3391/src/filterPhone.ts#L6)
|
|
396
427
|
|
|
397
428
|
___
|
|
398
429
|
|
|
@@ -415,7 +446,7 @@ ___
|
|
|
415
446
|
|
|
416
447
|
#### Defined in
|
|
417
448
|
|
|
418
|
-
[formatAmount.ts:4](https://github.com/daysnap/utils/blob/
|
|
449
|
+
[formatAmount.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/formatAmount.ts#L4)
|
|
419
450
|
|
|
420
451
|
___
|
|
421
452
|
|
|
@@ -438,7 +469,7 @@ ___
|
|
|
438
469
|
|
|
439
470
|
#### Defined in
|
|
440
471
|
|
|
441
|
-
[formatDate.ts:6](https://github.com/daysnap/utils/blob/
|
|
472
|
+
[formatDate.ts:6](https://github.com/daysnap/utils/blob/eba3391/src/formatDate.ts#L6)
|
|
442
473
|
|
|
443
474
|
___
|
|
444
475
|
|
|
@@ -460,7 +491,7 @@ ___
|
|
|
460
491
|
|
|
461
492
|
#### Defined in
|
|
462
493
|
|
|
463
|
-
[getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/
|
|
494
|
+
[getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/getBlobByUrl.ts#L4)
|
|
464
495
|
|
|
465
496
|
___
|
|
466
497
|
|
|
@@ -483,7 +514,7 @@ ___
|
|
|
483
514
|
|
|
484
515
|
#### Defined in
|
|
485
516
|
|
|
486
|
-
[storage/index.ts:7](https://github.com/daysnap/utils/blob/
|
|
517
|
+
[storage/index.ts:7](https://github.com/daysnap/utils/blob/eba3391/src/storage/index.ts#L7)
|
|
487
518
|
|
|
488
519
|
___
|
|
489
520
|
|
|
@@ -505,7 +536,7 @@ ___
|
|
|
505
536
|
|
|
506
537
|
#### Defined in
|
|
507
538
|
|
|
508
|
-
[getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/
|
|
539
|
+
[getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/getDayMillisecond.ts#L4)
|
|
509
540
|
|
|
510
541
|
___
|
|
511
542
|
|
|
@@ -527,7 +558,7 @@ ___
|
|
|
527
558
|
|
|
528
559
|
#### Defined in
|
|
529
560
|
|
|
530
|
-
[getImageInfo.ts:4](https://github.com/daysnap/utils/blob/
|
|
561
|
+
[getImageInfo.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/getImageInfo.ts#L4)
|
|
531
562
|
|
|
532
563
|
___
|
|
533
564
|
|
|
@@ -550,7 +581,23 @@ ___
|
|
|
550
581
|
|
|
551
582
|
#### Defined in
|
|
552
583
|
|
|
553
|
-
[storage/index.ts:7](https://github.com/daysnap/utils/blob/
|
|
584
|
+
[storage/index.ts:7](https://github.com/daysnap/utils/blob/eba3391/src/storage/index.ts#L7)
|
|
585
|
+
|
|
586
|
+
___
|
|
587
|
+
|
|
588
|
+
### getRandomColor
|
|
589
|
+
|
|
590
|
+
▸ **getRandomColor**(): `string`
|
|
591
|
+
|
|
592
|
+
随机颜色
|
|
593
|
+
|
|
594
|
+
#### Returns
|
|
595
|
+
|
|
596
|
+
`string`
|
|
597
|
+
|
|
598
|
+
#### Defined in
|
|
599
|
+
|
|
600
|
+
[getRandomColor.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/getRandomColor.ts#L4)
|
|
554
601
|
|
|
555
602
|
___
|
|
556
603
|
|
|
@@ -572,7 +619,7 @@ ___
|
|
|
572
619
|
|
|
573
620
|
#### Defined in
|
|
574
621
|
|
|
575
|
-
[getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/
|
|
622
|
+
[getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/getVideoInfo.ts#L4)
|
|
576
623
|
|
|
577
624
|
___
|
|
578
625
|
|
|
@@ -588,7 +635,7 @@ ___
|
|
|
588
635
|
|
|
589
636
|
#### Defined in
|
|
590
637
|
|
|
591
|
-
[inBrowser.ts:4](https://github.com/daysnap/utils/blob/
|
|
638
|
+
[inBrowser.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/inBrowser.ts#L4)
|
|
592
639
|
|
|
593
640
|
___
|
|
594
641
|
|
|
@@ -604,7 +651,31 @@ ___
|
|
|
604
651
|
|
|
605
652
|
#### Defined in
|
|
606
653
|
|
|
607
|
-
[isAndroid.ts:4](https://github.com/daysnap/utils/blob/
|
|
654
|
+
[isAndroid.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isAndroid.ts#L4)
|
|
655
|
+
|
|
656
|
+
___
|
|
657
|
+
|
|
658
|
+
### isArray
|
|
659
|
+
|
|
660
|
+
▸ **isArray**(`val`): val is any[]
|
|
661
|
+
|
|
662
|
+
判断是否是数组
|
|
663
|
+
|
|
664
|
+
#### Parameters
|
|
665
|
+
|
|
666
|
+
| Name | Type | Description |
|
|
667
|
+
| :------ | :------ | :------ |
|
|
668
|
+
| `val` | `unknown` | 待判断值 |
|
|
669
|
+
|
|
670
|
+
#### Returns
|
|
671
|
+
|
|
672
|
+
val is any[]
|
|
673
|
+
|
|
674
|
+
是否
|
|
675
|
+
|
|
676
|
+
#### Defined in
|
|
677
|
+
|
|
678
|
+
[isArray.ts:6](https://github.com/daysnap/utils/blob/eba3391/src/isArray.ts#L6)
|
|
608
679
|
|
|
609
680
|
___
|
|
610
681
|
|
|
@@ -626,7 +697,7 @@ val is boolean
|
|
|
626
697
|
|
|
627
698
|
#### Defined in
|
|
628
699
|
|
|
629
|
-
isBoolean.ts:5
|
|
700
|
+
[isBoolean.ts:5](https://github.com/daysnap/utils/blob/eba3391/src/isBoolean.ts#L5)
|
|
630
701
|
|
|
631
702
|
___
|
|
632
703
|
|
|
@@ -648,7 +719,7 @@ ___
|
|
|
648
719
|
|
|
649
720
|
#### Defined in
|
|
650
721
|
|
|
651
|
-
[isEmail.ts:4](https://github.com/daysnap/utils/blob/
|
|
722
|
+
[isEmail.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isEmail.ts#L4)
|
|
652
723
|
|
|
653
724
|
___
|
|
654
725
|
|
|
@@ -670,7 +741,7 @@ ___
|
|
|
670
741
|
|
|
671
742
|
#### Defined in
|
|
672
743
|
|
|
673
|
-
[isEmpty.ts:6](https://github.com/daysnap/utils/blob/
|
|
744
|
+
[isEmpty.ts:6](https://github.com/daysnap/utils/blob/eba3391/src/isEmpty.ts#L6)
|
|
674
745
|
|
|
675
746
|
___
|
|
676
747
|
|
|
@@ -692,7 +763,7 @@ ___
|
|
|
692
763
|
|
|
693
764
|
#### Defined in
|
|
694
765
|
|
|
695
|
-
[isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/
|
|
766
|
+
[isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/eba3391/src/isEmptyObject.ts#L5)
|
|
696
767
|
|
|
697
768
|
___
|
|
698
769
|
|
|
@@ -714,7 +785,7 @@ val is Error
|
|
|
714
785
|
|
|
715
786
|
#### Defined in
|
|
716
787
|
|
|
717
|
-
[isError.ts:4](https://github.com/daysnap/utils/blob/
|
|
788
|
+
[isError.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isError.ts#L4)
|
|
718
789
|
|
|
719
790
|
___
|
|
720
791
|
|
|
@@ -736,7 +807,7 @@ val is Function
|
|
|
736
807
|
|
|
737
808
|
#### Defined in
|
|
738
809
|
|
|
739
|
-
[isFunction.ts:4](https://github.com/daysnap/utils/blob/
|
|
810
|
+
[isFunction.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isFunction.ts#L4)
|
|
740
811
|
|
|
741
812
|
___
|
|
742
813
|
|
|
@@ -752,7 +823,7 @@ ___
|
|
|
752
823
|
|
|
753
824
|
#### Defined in
|
|
754
825
|
|
|
755
|
-
[isIOS.ts:4](https://github.com/daysnap/utils/blob/
|
|
826
|
+
[isIOS.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isIOS.ts#L4)
|
|
756
827
|
|
|
757
828
|
___
|
|
758
829
|
|
|
@@ -774,7 +845,7 @@ ___
|
|
|
774
845
|
|
|
775
846
|
#### Defined in
|
|
776
847
|
|
|
777
|
-
[isIdCard.ts:4](https://github.com/daysnap/utils/blob/
|
|
848
|
+
[isIdCard.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isIdCard.ts#L4)
|
|
778
849
|
|
|
779
850
|
___
|
|
780
851
|
|
|
@@ -796,7 +867,7 @@ ___
|
|
|
796
867
|
|
|
797
868
|
#### Defined in
|
|
798
869
|
|
|
799
|
-
[isJSONString.ts:7](https://github.com/daysnap/utils/blob/
|
|
870
|
+
[isJSONString.ts:7](https://github.com/daysnap/utils/blob/eba3391/src/isJSONString.ts#L7)
|
|
800
871
|
|
|
801
872
|
___
|
|
802
873
|
|
|
@@ -818,7 +889,7 @@ ___
|
|
|
818
889
|
|
|
819
890
|
#### Defined in
|
|
820
891
|
|
|
821
|
-
[isLan.ts:5](https://github.com/daysnap/utils/blob/
|
|
892
|
+
[isLan.ts:5](https://github.com/daysnap/utils/blob/eba3391/src/isLan.ts#L5)
|
|
822
893
|
|
|
823
894
|
___
|
|
824
895
|
|
|
@@ -840,7 +911,7 @@ ___
|
|
|
840
911
|
|
|
841
912
|
#### Defined in
|
|
842
913
|
|
|
843
|
-
[isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/
|
|
914
|
+
[isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/eba3391/src/isLicenseCode.ts#L5)
|
|
844
915
|
|
|
845
916
|
___
|
|
846
917
|
|
|
@@ -856,7 +927,7 @@ ___
|
|
|
856
927
|
|
|
857
928
|
#### Defined in
|
|
858
929
|
|
|
859
|
-
[isMobile.ts:4](https://github.com/daysnap/utils/blob/
|
|
930
|
+
[isMobile.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isMobile.ts#L4)
|
|
860
931
|
|
|
861
932
|
___
|
|
862
933
|
|
|
@@ -878,7 +949,7 @@ val is null
|
|
|
878
949
|
|
|
879
950
|
#### Defined in
|
|
880
951
|
|
|
881
|
-
[isNull.ts:4](https://github.com/daysnap/utils/blob/
|
|
952
|
+
[isNull.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isNull.ts#L4)
|
|
882
953
|
|
|
883
954
|
___
|
|
884
955
|
|
|
@@ -900,7 +971,7 @@ val is number
|
|
|
900
971
|
|
|
901
972
|
#### Defined in
|
|
902
973
|
|
|
903
|
-
[isNumber.ts:5](https://github.com/daysnap/utils/blob/
|
|
974
|
+
[isNumber.ts:5](https://github.com/daysnap/utils/blob/eba3391/src/isNumber.ts#L5)
|
|
904
975
|
|
|
905
976
|
___
|
|
906
977
|
|
|
@@ -922,7 +993,7 @@ val is Record<string, any\>
|
|
|
922
993
|
|
|
923
994
|
#### Defined in
|
|
924
995
|
|
|
925
|
-
[isObject.ts:4](https://github.com/daysnap/utils/blob/
|
|
996
|
+
[isObject.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isObject.ts#L4)
|
|
926
997
|
|
|
927
998
|
___
|
|
928
999
|
|
|
@@ -944,7 +1015,7 @@ ___
|
|
|
944
1015
|
|
|
945
1016
|
#### Defined in
|
|
946
1017
|
|
|
947
|
-
[isPhone.ts:4](https://github.com/daysnap/utils/blob/
|
|
1018
|
+
[isPhone.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isPhone.ts#L4)
|
|
948
1019
|
|
|
949
1020
|
___
|
|
950
1021
|
|
|
@@ -972,7 +1043,7 @@ val is Promise<T\>
|
|
|
972
1043
|
|
|
973
1044
|
#### Defined in
|
|
974
1045
|
|
|
975
|
-
[isPromise.ts:4](https://github.com/daysnap/utils/blob/
|
|
1046
|
+
[isPromise.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isPromise.ts#L4)
|
|
976
1047
|
|
|
977
1048
|
___
|
|
978
1049
|
|
|
@@ -994,7 +1065,7 @@ val is RegExp
|
|
|
994
1065
|
|
|
995
1066
|
#### Defined in
|
|
996
1067
|
|
|
997
|
-
[isRegExp.ts:4](https://github.com/daysnap/utils/blob/
|
|
1068
|
+
[isRegExp.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isRegExp.ts#L4)
|
|
998
1069
|
|
|
999
1070
|
___
|
|
1000
1071
|
|
|
@@ -1016,7 +1087,7 @@ val is string
|
|
|
1016
1087
|
|
|
1017
1088
|
#### Defined in
|
|
1018
1089
|
|
|
1019
|
-
[isString.ts:4](https://github.com/daysnap/utils/blob/
|
|
1090
|
+
[isString.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isString.ts#L4)
|
|
1020
1091
|
|
|
1021
1092
|
___
|
|
1022
1093
|
|
|
@@ -1038,7 +1109,23 @@ val is undefined
|
|
|
1038
1109
|
|
|
1039
1110
|
#### Defined in
|
|
1040
1111
|
|
|
1041
|
-
[isUndefined.ts:4](https://github.com/daysnap/utils/blob/
|
|
1112
|
+
[isUndefined.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isUndefined.ts#L4)
|
|
1113
|
+
|
|
1114
|
+
___
|
|
1115
|
+
|
|
1116
|
+
### isWeixin
|
|
1117
|
+
|
|
1118
|
+
▸ **isWeixin**(): `boolean`
|
|
1119
|
+
|
|
1120
|
+
是否是微信环境
|
|
1121
|
+
|
|
1122
|
+
#### Returns
|
|
1123
|
+
|
|
1124
|
+
`boolean`
|
|
1125
|
+
|
|
1126
|
+
#### Defined in
|
|
1127
|
+
|
|
1128
|
+
[isWeixin.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/isWeixin.ts#L4)
|
|
1042
1129
|
|
|
1043
1130
|
___
|
|
1044
1131
|
|
|
@@ -1060,7 +1147,31 @@ val is Window
|
|
|
1060
1147
|
|
|
1061
1148
|
#### Defined in
|
|
1062
1149
|
|
|
1063
|
-
[isWindow.ts:5](https://github.com/daysnap/utils/blob/
|
|
1150
|
+
[isWindow.ts:5](https://github.com/daysnap/utils/blob/eba3391/src/isWindow.ts#L5)
|
|
1151
|
+
|
|
1152
|
+
___
|
|
1153
|
+
|
|
1154
|
+
### loadResource
|
|
1155
|
+
|
|
1156
|
+
▸ **loadResource**(`res`, `type`, `callback?`): `void`
|
|
1157
|
+
|
|
1158
|
+
加载外部js、css、写入style样式
|
|
1159
|
+
|
|
1160
|
+
#### Parameters
|
|
1161
|
+
|
|
1162
|
+
| Name | Type | Description |
|
|
1163
|
+
| :------ | :------ | :------ |
|
|
1164
|
+
| `res` | `string` | 资源url或内容 |
|
|
1165
|
+
| `type` | ``"style"`` \| ``"js"`` \| ``"css"`` | 类型 |
|
|
1166
|
+
| `callback?` | `any` | 回调函数 |
|
|
1167
|
+
|
|
1168
|
+
#### Returns
|
|
1169
|
+
|
|
1170
|
+
`void`
|
|
1171
|
+
|
|
1172
|
+
#### Defined in
|
|
1173
|
+
|
|
1174
|
+
[loadResource.ts:9](https://github.com/daysnap/utils/blob/eba3391/src/loadResource.ts#L9)
|
|
1064
1175
|
|
|
1065
1176
|
___
|
|
1066
1177
|
|
|
@@ -1090,7 +1201,31 @@ ___
|
|
|
1090
1201
|
|
|
1091
1202
|
#### Defined in
|
|
1092
1203
|
|
|
1093
|
-
[omit.ts:4](https://github.com/daysnap/utils/blob/
|
|
1204
|
+
[omit.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/omit.ts#L4)
|
|
1205
|
+
|
|
1206
|
+
___
|
|
1207
|
+
|
|
1208
|
+
### padding
|
|
1209
|
+
|
|
1210
|
+
▸ **padding**(`message`, `before?`, `after?`): `string`
|
|
1211
|
+
|
|
1212
|
+
增添空格
|
|
1213
|
+
|
|
1214
|
+
#### Parameters
|
|
1215
|
+
|
|
1216
|
+
| Name | Type | Default value | Description |
|
|
1217
|
+
| :------ | :------ | :------ | :------ |
|
|
1218
|
+
| `message` | `string` | `undefined` | 文字信息 |
|
|
1219
|
+
| `before` | `number` | `1` | 前空格个数 |
|
|
1220
|
+
| `after` | `number` | `1` | 后空格个数 |
|
|
1221
|
+
|
|
1222
|
+
#### Returns
|
|
1223
|
+
|
|
1224
|
+
`string`
|
|
1225
|
+
|
|
1226
|
+
#### Defined in
|
|
1227
|
+
|
|
1228
|
+
padding.ts:7
|
|
1094
1229
|
|
|
1095
1230
|
___
|
|
1096
1231
|
|
|
@@ -1112,7 +1247,7 @@ ___
|
|
|
1112
1247
|
|
|
1113
1248
|
#### Defined in
|
|
1114
1249
|
|
|
1115
|
-
[parseDate.ts:4](https://github.com/daysnap/utils/blob/
|
|
1250
|
+
[parseDate.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/parseDate.ts#L4)
|
|
1116
1251
|
|
|
1117
1252
|
___
|
|
1118
1253
|
|
|
@@ -1135,7 +1270,36 @@ ___
|
|
|
1135
1270
|
|
|
1136
1271
|
#### Defined in
|
|
1137
1272
|
|
|
1138
|
-
[parseError.ts:8](https://github.com/daysnap/utils/blob/
|
|
1273
|
+
[parseError.ts:8](https://github.com/daysnap/utils/blob/eba3391/src/parseError.ts#L8)
|
|
1274
|
+
|
|
1275
|
+
___
|
|
1276
|
+
|
|
1277
|
+
### parseObject
|
|
1278
|
+
|
|
1279
|
+
▸ **parseObject**<`T`\>(`path`, `value`): `T`
|
|
1280
|
+
|
|
1281
|
+
返回对象
|
|
1282
|
+
|
|
1283
|
+
#### Type parameters
|
|
1284
|
+
|
|
1285
|
+
| Name | Type |
|
|
1286
|
+
| :------ | :------ |
|
|
1287
|
+
| `T` | `any` |
|
|
1288
|
+
|
|
1289
|
+
#### Parameters
|
|
1290
|
+
|
|
1291
|
+
| Name | Type |
|
|
1292
|
+
| :------ | :------ |
|
|
1293
|
+
| `path` | `string` |
|
|
1294
|
+
| `value` | `any` |
|
|
1295
|
+
|
|
1296
|
+
#### Returns
|
|
1297
|
+
|
|
1298
|
+
`T`
|
|
1299
|
+
|
|
1300
|
+
#### Defined in
|
|
1301
|
+
|
|
1302
|
+
parseObject.ts:4
|
|
1139
1303
|
|
|
1140
1304
|
___
|
|
1141
1305
|
|
|
@@ -1164,7 +1328,7 @@ ___
|
|
|
1164
1328
|
|
|
1165
1329
|
#### Defined in
|
|
1166
1330
|
|
|
1167
|
-
[parsePath.ts:4](https://github.com/daysnap/utils/blob/
|
|
1331
|
+
[parsePath.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/parsePath.ts#L4)
|
|
1168
1332
|
|
|
1169
1333
|
___
|
|
1170
1334
|
|
|
@@ -1187,7 +1351,7 @@ ___
|
|
|
1187
1351
|
|
|
1188
1352
|
#### Defined in
|
|
1189
1353
|
|
|
1190
|
-
[parseQuery.ts:8](https://github.com/daysnap/utils/blob/
|
|
1354
|
+
[parseQuery.ts:8](https://github.com/daysnap/utils/blob/eba3391/src/parseQuery.ts#L8)
|
|
1191
1355
|
|
|
1192
1356
|
___
|
|
1193
1357
|
|
|
@@ -1217,7 +1381,7 @@ ___
|
|
|
1217
1381
|
|
|
1218
1382
|
#### Defined in
|
|
1219
1383
|
|
|
1220
|
-
[pick.ts:4](https://github.com/daysnap/utils/blob/
|
|
1384
|
+
[pick.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/pick.ts#L4)
|
|
1221
1385
|
|
|
1222
1386
|
___
|
|
1223
1387
|
|
|
@@ -1240,7 +1404,7 @@ ___
|
|
|
1240
1404
|
|
|
1241
1405
|
#### Defined in
|
|
1242
1406
|
|
|
1243
|
-
[replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/
|
|
1407
|
+
[replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/replaceCrlf.ts#L4)
|
|
1244
1408
|
|
|
1245
1409
|
___
|
|
1246
1410
|
|
|
@@ -1266,7 +1430,7 @@ reserve(0, '--') => 0
|
|
|
1266
1430
|
|
|
1267
1431
|
#### Defined in
|
|
1268
1432
|
|
|
1269
|
-
[reserve.ts:8](https://github.com/daysnap/utils/blob/
|
|
1433
|
+
[reserve.ts:8](https://github.com/daysnap/utils/blob/eba3391/src/reserve.ts#L8)
|
|
1270
1434
|
|
|
1271
1435
|
___
|
|
1272
1436
|
|
|
@@ -1289,7 +1453,7 @@ ___
|
|
|
1289
1453
|
|
|
1290
1454
|
#### Defined in
|
|
1291
1455
|
|
|
1292
|
-
[round.ts:6](https://github.com/daysnap/utils/blob/
|
|
1456
|
+
[round.ts:6](https://github.com/daysnap/utils/blob/eba3391/src/round.ts#L6)
|
|
1293
1457
|
|
|
1294
1458
|
___
|
|
1295
1459
|
|
|
@@ -1312,7 +1476,30 @@ ___
|
|
|
1312
1476
|
|
|
1313
1477
|
#### Defined in
|
|
1314
1478
|
|
|
1315
|
-
[sleep.ts:4](https://github.com/daysnap/utils/blob/
|
|
1479
|
+
[sleep.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/sleep.ts#L4)
|
|
1480
|
+
|
|
1481
|
+
___
|
|
1482
|
+
|
|
1483
|
+
### stringTrim
|
|
1484
|
+
|
|
1485
|
+
▸ **stringTrim**(`str`, `type?`): `string`
|
|
1486
|
+
|
|
1487
|
+
去除字符串空格
|
|
1488
|
+
|
|
1489
|
+
#### Parameters
|
|
1490
|
+
|
|
1491
|
+
| Name | Type |
|
|
1492
|
+
| :------ | :------ |
|
|
1493
|
+
| `str` | `string` |
|
|
1494
|
+
| `type?` | ``1`` \| ``2`` \| ``3`` \| ``4`` |
|
|
1495
|
+
|
|
1496
|
+
#### Returns
|
|
1497
|
+
|
|
1498
|
+
`string`
|
|
1499
|
+
|
|
1500
|
+
#### Defined in
|
|
1501
|
+
|
|
1502
|
+
[stringTrim.ts:4](https://github.com/daysnap/utils/blob/eba3391/src/stringTrim.ts#L4)
|
|
1316
1503
|
|
|
1317
1504
|
___
|
|
1318
1505
|
|
|
@@ -1334,4 +1521,34 @@ ___
|
|
|
1334
1521
|
|
|
1335
1522
|
#### Defined in
|
|
1336
1523
|
|
|
1337
|
-
[stringifyQuery.ts:6](https://github.com/daysnap/utils/blob/
|
|
1524
|
+
[stringifyQuery.ts:6](https://github.com/daysnap/utils/blob/eba3391/src/stringifyQuery.ts#L6)
|
|
1525
|
+
|
|
1526
|
+
___
|
|
1527
|
+
|
|
1528
|
+
### typeOf
|
|
1529
|
+
|
|
1530
|
+
▸ **typeOf**<`T`\>(`val`): val is T
|
|
1531
|
+
|
|
1532
|
+
判断类型
|
|
1533
|
+
|
|
1534
|
+
#### Type parameters
|
|
1535
|
+
|
|
1536
|
+
| Name |
|
|
1537
|
+
| :------ |
|
|
1538
|
+
| `T` |
|
|
1539
|
+
|
|
1540
|
+
#### Parameters
|
|
1541
|
+
|
|
1542
|
+
| Name | Type | Description |
|
|
1543
|
+
| :------ | :------ | :------ |
|
|
1544
|
+
| `val` | `T` | 待判断数据 |
|
|
1545
|
+
|
|
1546
|
+
#### Returns
|
|
1547
|
+
|
|
1548
|
+
val is T
|
|
1549
|
+
|
|
1550
|
+
'undefined'|'null'|'boolean'|'string'|'number'|'object'|'array'|'function'|'symbol'|'map'|'weakmap'|'bigint'|'regexp'|'date'
|
|
1551
|
+
|
|
1552
|
+
#### Defined in
|
|
1553
|
+
|
|
1554
|
+
[typeOf.ts:6](https://github.com/daysnap/utils/blob/eba3391/src/typeOf.ts#L6)
|