@daysnap/utils 0.0.34 → 0.0.36

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 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,12 @@
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)
35
+ - [isBoolean](modules.md#isboolean)
32
36
  - [isEmail](modules.md#isemail)
33
37
  - [isEmpty](modules.md#isempty)
34
38
  - [isEmptyObject](modules.md#isemptyobject)
@@ -48,7 +52,9 @@
48
52
  - [isRegExp](modules.md#isregexp)
49
53
  - [isString](modules.md#isstring)
50
54
  - [isUndefined](modules.md#isundefined)
55
+ - [isWeixin](modules.md#isweixin)
51
56
  - [isWindow](modules.md#iswindow)
57
+ - [loadResource](modules.md#loadresource)
52
58
  - [omit](modules.md#omit)
53
59
  - [parseDate](modules.md#parsedate)
54
60
  - [parseError](modules.md#parseerror)
@@ -59,7 +65,9 @@
59
65
  - [reserve](modules.md#reserve)
60
66
  - [round](modules.md#round)
61
67
  - [sleep](modules.md#sleep)
68
+ - [stringTrim](modules.md#stringtrim)
62
69
  - [stringifyQuery](modules.md#stringifyquery)
70
+ - [typeOf](modules.md#typeof)
63
71
 
64
72
  ## Functions
65
73
 
@@ -82,7 +90,7 @@ base64 转 blob
82
90
 
83
91
  #### Defined in
84
92
 
85
- [base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/55f426c/src/base64ToBlob.ts#L6)
93
+ [base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/ce2c582/src/base64ToBlob.ts#L6)
86
94
 
87
95
  ___
88
96
 
@@ -104,7 +112,7 @@ blob 转 base64
104
112
 
105
113
  #### Defined in
106
114
 
107
- [blobToBase64.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/blobToBase64.ts#L4)
115
+ [blobToBase64.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/blobToBase64.ts#L4)
108
116
 
109
117
  ___
110
118
 
@@ -132,7 +140,7 @@ ___
132
140
 
133
141
  #### Defined in
134
142
 
135
- [clone.ts:7](https://github.com/daysnap/utils/blob/55f426c/src/clone.ts#L7)
143
+ [clone.ts:7](https://github.com/daysnap/utils/blob/ce2c582/src/clone.ts#L7)
136
144
 
137
145
  ___
138
146
 
@@ -154,7 +162,7 @@ ___
154
162
 
155
163
  #### Defined in
156
164
 
157
- [createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/createHexColorByHash.ts#L4)
165
+ [createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/createHexColorByHash.ts#L4)
158
166
 
159
167
  ___
160
168
 
@@ -180,7 +188,7 @@ ___
180
188
 
181
189
  #### Defined in
182
190
 
183
- [compareVersion.ts:9](https://github.com/daysnap/utils/blob/55f426c/src/compareVersion.ts#L9)
191
+ [compareVersion.ts:9](https://github.com/daysnap/utils/blob/ce2c582/src/compareVersion.ts#L9)
184
192
 
185
193
  ___
186
194
 
@@ -202,7 +210,7 @@ ___
202
210
 
203
211
  #### Defined in
204
212
 
205
- [compressImage.ts:6](https://github.com/daysnap/utils/blob/55f426c/src/compressImage.ts#L6)
213
+ [compressImage.ts:6](https://github.com/daysnap/utils/blob/ce2c582/src/compressImage.ts#L6)
206
214
 
207
215
  ___
208
216
 
@@ -226,7 +234,7 @@ ___
226
234
 
227
235
  #### Defined in
228
236
 
229
- [downloadFile.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/downloadFile.ts#L4)
237
+ [downloadFile.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/downloadFile.ts#L4)
230
238
 
231
239
  ___
232
240
 
@@ -255,7 +263,7 @@ ___
255
263
 
256
264
  #### Defined in
257
265
 
258
- [each.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/each.ts#L4)
266
+ [each.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/each.ts#L4)
259
267
 
260
268
  ▸ **each**<`T`\>(`data`, `callback`): `void`
261
269
 
@@ -278,7 +286,7 @@ ___
278
286
 
279
287
  #### Defined in
280
288
 
281
- [each.ts:8](https://github.com/daysnap/utils/blob/55f426c/src/each.ts#L8)
289
+ [each.ts:8](https://github.com/daysnap/utils/blob/ce2c582/src/each.ts#L8)
282
290
 
283
291
  ___
284
292
 
@@ -300,7 +308,29 @@ ___
300
308
 
301
309
  #### Defined in
302
310
 
303
- [filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/filterBankCardNo.ts#L4)
311
+ [filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/filterBankCardNo.ts#L4)
312
+
313
+ ___
314
+
315
+ ### filterCRLF
316
+
317
+ ▸ **filterCRLF**(`v`): `string`
318
+
319
+ 替换字符串里面的回车换行符
320
+
321
+ #### Parameters
322
+
323
+ | Name | Type |
324
+ | :------ | :------ |
325
+ | `v` | `string` |
326
+
327
+ #### Returns
328
+
329
+ `string`
330
+
331
+ #### Defined in
332
+
333
+ [filterCRLF.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/filterCRLF.ts#L4)
304
334
 
305
335
  ___
306
336
 
@@ -322,7 +352,7 @@ ___
322
352
 
323
353
  #### Defined in
324
354
 
325
- [filterEmoji.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/filterEmoji.ts#L4)
355
+ [filterEmoji.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/filterEmoji.ts#L4)
326
356
 
327
357
  ___
328
358
 
@@ -344,7 +374,7 @@ ___
344
374
 
345
375
  #### Defined in
346
376
 
347
- [filterIdCard.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/filterIdCard.ts#L4)
377
+ [filterIdCard.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/filterIdCard.ts#L4)
348
378
 
349
379
  ___
350
380
 
@@ -366,7 +396,7 @@ ___
366
396
 
367
397
  #### Defined in
368
398
 
369
- [filterName.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/filterName.ts#L4)
399
+ [filterName.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/filterName.ts#L4)
370
400
 
371
401
  ___
372
402
 
@@ -391,7 +421,7 @@ filterPhone('13177778888', ' ') => 131 **** 8888
391
421
 
392
422
  #### Defined in
393
423
 
394
- [filterPhone.ts:6](https://github.com/daysnap/utils/blob/55f426c/src/filterPhone.ts#L6)
424
+ [filterPhone.ts:6](https://github.com/daysnap/utils/blob/ce2c582/src/filterPhone.ts#L6)
395
425
 
396
426
  ___
397
427
 
@@ -414,7 +444,7 @@ ___
414
444
 
415
445
  #### Defined in
416
446
 
417
- [formatAmount.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/formatAmount.ts#L4)
447
+ [formatAmount.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/formatAmount.ts#L4)
418
448
 
419
449
  ___
420
450
 
@@ -437,7 +467,7 @@ ___
437
467
 
438
468
  #### Defined in
439
469
 
440
- [formatDate.ts:6](https://github.com/daysnap/utils/blob/55f426c/src/formatDate.ts#L6)
470
+ [formatDate.ts:6](https://github.com/daysnap/utils/blob/ce2c582/src/formatDate.ts#L6)
441
471
 
442
472
  ___
443
473
 
@@ -459,7 +489,7 @@ ___
459
489
 
460
490
  #### Defined in
461
491
 
462
- [getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/getBlobByUrl.ts#L4)
492
+ [getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/getBlobByUrl.ts#L4)
463
493
 
464
494
  ___
465
495
 
@@ -482,7 +512,7 @@ ___
482
512
 
483
513
  #### Defined in
484
514
 
485
- [storage/index.ts:7](https://github.com/daysnap/utils/blob/55f426c/src/storage/index.ts#L7)
515
+ [storage/index.ts:7](https://github.com/daysnap/utils/blob/ce2c582/src/storage/index.ts#L7)
486
516
 
487
517
  ___
488
518
 
@@ -504,7 +534,7 @@ ___
504
534
 
505
535
  #### Defined in
506
536
 
507
- [getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/getDayMillisecond.ts#L4)
537
+ [getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/getDayMillisecond.ts#L4)
508
538
 
509
539
  ___
510
540
 
@@ -526,7 +556,7 @@ ___
526
556
 
527
557
  #### Defined in
528
558
 
529
- [getImageInfo.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/getImageInfo.ts#L4)
559
+ [getImageInfo.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/getImageInfo.ts#L4)
530
560
 
531
561
  ___
532
562
 
@@ -549,7 +579,23 @@ ___
549
579
 
550
580
  #### Defined in
551
581
 
552
- [storage/index.ts:7](https://github.com/daysnap/utils/blob/55f426c/src/storage/index.ts#L7)
582
+ [storage/index.ts:7](https://github.com/daysnap/utils/blob/ce2c582/src/storage/index.ts#L7)
583
+
584
+ ___
585
+
586
+ ### getRandomColor
587
+
588
+ ▸ **getRandomColor**(): `string`
589
+
590
+ 随机颜色
591
+
592
+ #### Returns
593
+
594
+ `string`
595
+
596
+ #### Defined in
597
+
598
+ [getRandomColor.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/getRandomColor.ts#L4)
553
599
 
554
600
  ___
555
601
 
@@ -571,7 +617,7 @@ ___
571
617
 
572
618
  #### Defined in
573
619
 
574
- [getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/getVideoInfo.ts#L4)
620
+ [getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/getVideoInfo.ts#L4)
575
621
 
576
622
  ___
577
623
 
@@ -587,7 +633,7 @@ ___
587
633
 
588
634
  #### Defined in
589
635
 
590
- [inBrowser.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/inBrowser.ts#L4)
636
+ [inBrowser.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/inBrowser.ts#L4)
591
637
 
592
638
  ___
593
639
 
@@ -603,7 +649,53 @@ ___
603
649
 
604
650
  #### Defined in
605
651
 
606
- [isAndroid.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isAndroid.ts#L4)
652
+ [isAndroid.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isAndroid.ts#L4)
653
+
654
+ ___
655
+
656
+ ### isArray
657
+
658
+ ▸ **isArray**(`val`): val is any[]
659
+
660
+ 判断是否是数组
661
+
662
+ #### Parameters
663
+
664
+ | Name | Type | Description |
665
+ | :------ | :------ | :------ |
666
+ | `val` | `unknown` | 待判断值 |
667
+
668
+ #### Returns
669
+
670
+ val is any[]
671
+
672
+ 是否
673
+
674
+ #### Defined in
675
+
676
+ [isArray.ts:6](https://github.com/daysnap/utils/blob/ce2c582/src/isArray.ts#L6)
677
+
678
+ ___
679
+
680
+ ### isBoolean
681
+
682
+ ▸ **isBoolean**(`val`): val is boolean
683
+
684
+ 判断是否是布尔值
685
+
686
+ #### Parameters
687
+
688
+ | Name | Type | Description |
689
+ | :------ | :------ | :------ |
690
+ | `val` | `unknown` | 需要判断的值 |
691
+
692
+ #### Returns
693
+
694
+ val is boolean
695
+
696
+ #### Defined in
697
+
698
+ [isBoolean.ts:5](https://github.com/daysnap/utils/blob/ce2c582/src/isBoolean.ts#L5)
607
699
 
608
700
  ___
609
701
 
@@ -625,7 +717,7 @@ ___
625
717
 
626
718
  #### Defined in
627
719
 
628
- [isEmail.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isEmail.ts#L4)
720
+ [isEmail.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isEmail.ts#L4)
629
721
 
630
722
  ___
631
723
 
@@ -647,7 +739,7 @@ ___
647
739
 
648
740
  #### Defined in
649
741
 
650
- [isEmpty.ts:6](https://github.com/daysnap/utils/blob/55f426c/src/isEmpty.ts#L6)
742
+ [isEmpty.ts:6](https://github.com/daysnap/utils/blob/ce2c582/src/isEmpty.ts#L6)
651
743
 
652
744
  ___
653
745
 
@@ -669,7 +761,7 @@ ___
669
761
 
670
762
  #### Defined in
671
763
 
672
- [isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/55f426c/src/isEmptyObject.ts#L5)
764
+ [isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/ce2c582/src/isEmptyObject.ts#L5)
673
765
 
674
766
  ___
675
767
 
@@ -691,7 +783,7 @@ val is Error
691
783
 
692
784
  #### Defined in
693
785
 
694
- [isError.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isError.ts#L4)
786
+ [isError.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isError.ts#L4)
695
787
 
696
788
  ___
697
789
 
@@ -713,7 +805,7 @@ val is Function
713
805
 
714
806
  #### Defined in
715
807
 
716
- [isFunction.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isFunction.ts#L4)
808
+ [isFunction.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isFunction.ts#L4)
717
809
 
718
810
  ___
719
811
 
@@ -729,7 +821,7 @@ ___
729
821
 
730
822
  #### Defined in
731
823
 
732
- [isIOS.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isIOS.ts#L4)
824
+ [isIOS.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isIOS.ts#L4)
733
825
 
734
826
  ___
735
827
 
@@ -751,7 +843,7 @@ ___
751
843
 
752
844
  #### Defined in
753
845
 
754
- [isIdCard.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isIdCard.ts#L4)
846
+ [isIdCard.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isIdCard.ts#L4)
755
847
 
756
848
  ___
757
849
 
@@ -773,7 +865,7 @@ ___
773
865
 
774
866
  #### Defined in
775
867
 
776
- [isJSONString.ts:7](https://github.com/daysnap/utils/blob/55f426c/src/isJSONString.ts#L7)
868
+ [isJSONString.ts:7](https://github.com/daysnap/utils/blob/ce2c582/src/isJSONString.ts#L7)
777
869
 
778
870
  ___
779
871
 
@@ -795,7 +887,7 @@ ___
795
887
 
796
888
  #### Defined in
797
889
 
798
- [isLan.ts:5](https://github.com/daysnap/utils/blob/55f426c/src/isLan.ts#L5)
890
+ [isLan.ts:5](https://github.com/daysnap/utils/blob/ce2c582/src/isLan.ts#L5)
799
891
 
800
892
  ___
801
893
 
@@ -817,7 +909,7 @@ ___
817
909
 
818
910
  #### Defined in
819
911
 
820
- [isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/55f426c/src/isLicenseCode.ts#L5)
912
+ [isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/ce2c582/src/isLicenseCode.ts#L5)
821
913
 
822
914
  ___
823
915
 
@@ -833,7 +925,7 @@ ___
833
925
 
834
926
  #### Defined in
835
927
 
836
- [isMobile.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isMobile.ts#L4)
928
+ [isMobile.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isMobile.ts#L4)
837
929
 
838
930
  ___
839
931
 
@@ -855,7 +947,7 @@ val is null
855
947
 
856
948
  #### Defined in
857
949
 
858
- [isNull.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isNull.ts#L4)
950
+ [isNull.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isNull.ts#L4)
859
951
 
860
952
  ___
861
953
 
@@ -877,7 +969,7 @@ val is number
877
969
 
878
970
  #### Defined in
879
971
 
880
- [isNumber.ts:5](https://github.com/daysnap/utils/blob/55f426c/src/isNumber.ts#L5)
972
+ [isNumber.ts:5](https://github.com/daysnap/utils/blob/ce2c582/src/isNumber.ts#L5)
881
973
 
882
974
  ___
883
975
 
@@ -899,7 +991,7 @@ val is Record<string, any\>
899
991
 
900
992
  #### Defined in
901
993
 
902
- [isObject.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isObject.ts#L4)
994
+ [isObject.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isObject.ts#L4)
903
995
 
904
996
  ___
905
997
 
@@ -921,7 +1013,7 @@ ___
921
1013
 
922
1014
  #### Defined in
923
1015
 
924
- [isPhone.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isPhone.ts#L4)
1016
+ [isPhone.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isPhone.ts#L4)
925
1017
 
926
1018
  ___
927
1019
 
@@ -949,7 +1041,7 @@ val is Promise<T\>
949
1041
 
950
1042
  #### Defined in
951
1043
 
952
- [isPromise.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isPromise.ts#L4)
1044
+ [isPromise.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isPromise.ts#L4)
953
1045
 
954
1046
  ___
955
1047
 
@@ -971,7 +1063,7 @@ val is RegExp
971
1063
 
972
1064
  #### Defined in
973
1065
 
974
- [isRegExp.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isRegExp.ts#L4)
1066
+ [isRegExp.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isRegExp.ts#L4)
975
1067
 
976
1068
  ___
977
1069
 
@@ -993,7 +1085,7 @@ val is string
993
1085
 
994
1086
  #### Defined in
995
1087
 
996
- [isString.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isString.ts#L4)
1088
+ [isString.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isString.ts#L4)
997
1089
 
998
1090
  ___
999
1091
 
@@ -1015,7 +1107,23 @@ val is undefined
1015
1107
 
1016
1108
  #### Defined in
1017
1109
 
1018
- [isUndefined.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/isUndefined.ts#L4)
1110
+ [isUndefined.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isUndefined.ts#L4)
1111
+
1112
+ ___
1113
+
1114
+ ### isWeixin
1115
+
1116
+ ▸ **isWeixin**(): `boolean`
1117
+
1118
+ 是否是微信环境
1119
+
1120
+ #### Returns
1121
+
1122
+ `boolean`
1123
+
1124
+ #### Defined in
1125
+
1126
+ [isWeixin.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/isWeixin.ts#L4)
1019
1127
 
1020
1128
  ___
1021
1129
 
@@ -1037,7 +1145,31 @@ val is Window
1037
1145
 
1038
1146
  #### Defined in
1039
1147
 
1040
- [isWindow.ts:5](https://github.com/daysnap/utils/blob/55f426c/src/isWindow.ts#L5)
1148
+ [isWindow.ts:5](https://github.com/daysnap/utils/blob/ce2c582/src/isWindow.ts#L5)
1149
+
1150
+ ___
1151
+
1152
+ ### loadResource
1153
+
1154
+ ▸ **loadResource**(`res`, `type`, `callback?`): `void`
1155
+
1156
+ 加载外部js、css、写入style样式
1157
+
1158
+ #### Parameters
1159
+
1160
+ | Name | Type | Description |
1161
+ | :------ | :------ | :------ |
1162
+ | `res` | `string` | 资源url或内容 |
1163
+ | `type` | ``"style"`` \| ``"js"`` \| ``"css"`` | 类型 |
1164
+ | `callback?` | `any` | 回调函数 |
1165
+
1166
+ #### Returns
1167
+
1168
+ `void`
1169
+
1170
+ #### Defined in
1171
+
1172
+ [loadResource.ts:9](https://github.com/daysnap/utils/blob/ce2c582/src/loadResource.ts#L9)
1041
1173
 
1042
1174
  ___
1043
1175
 
@@ -1067,7 +1199,7 @@ ___
1067
1199
 
1068
1200
  #### Defined in
1069
1201
 
1070
- [omit.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/omit.ts#L4)
1202
+ [omit.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/omit.ts#L4)
1071
1203
 
1072
1204
  ___
1073
1205
 
@@ -1089,7 +1221,7 @@ ___
1089
1221
 
1090
1222
  #### Defined in
1091
1223
 
1092
- [parseDate.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/parseDate.ts#L4)
1224
+ [parseDate.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/parseDate.ts#L4)
1093
1225
 
1094
1226
  ___
1095
1227
 
@@ -1112,7 +1244,7 @@ ___
1112
1244
 
1113
1245
  #### Defined in
1114
1246
 
1115
- [parseError.ts:8](https://github.com/daysnap/utils/blob/55f426c/src/parseError.ts#L8)
1247
+ [parseError.ts:8](https://github.com/daysnap/utils/blob/ce2c582/src/parseError.ts#L8)
1116
1248
 
1117
1249
  ___
1118
1250
 
@@ -1141,7 +1273,7 @@ ___
1141
1273
 
1142
1274
  #### Defined in
1143
1275
 
1144
- [parsePath.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/parsePath.ts#L4)
1276
+ [parsePath.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/parsePath.ts#L4)
1145
1277
 
1146
1278
  ___
1147
1279
 
@@ -1164,7 +1296,7 @@ ___
1164
1296
 
1165
1297
  #### Defined in
1166
1298
 
1167
- [parseQuery.ts:8](https://github.com/daysnap/utils/blob/55f426c/src/parseQuery.ts#L8)
1299
+ [parseQuery.ts:8](https://github.com/daysnap/utils/blob/ce2c582/src/parseQuery.ts#L8)
1168
1300
 
1169
1301
  ___
1170
1302
 
@@ -1194,7 +1326,7 @@ ___
1194
1326
 
1195
1327
  #### Defined in
1196
1328
 
1197
- [pick.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/pick.ts#L4)
1329
+ [pick.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/pick.ts#L4)
1198
1330
 
1199
1331
  ___
1200
1332
 
@@ -1217,7 +1349,7 @@ ___
1217
1349
 
1218
1350
  #### Defined in
1219
1351
 
1220
- [replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/replaceCrlf.ts#L4)
1352
+ [replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/replaceCrlf.ts#L4)
1221
1353
 
1222
1354
  ___
1223
1355
 
@@ -1243,7 +1375,7 @@ reserve(0, '--') => 0
1243
1375
 
1244
1376
  #### Defined in
1245
1377
 
1246
- [reserve.ts:8](https://github.com/daysnap/utils/blob/55f426c/src/reserve.ts#L8)
1378
+ [reserve.ts:8](https://github.com/daysnap/utils/blob/ce2c582/src/reserve.ts#L8)
1247
1379
 
1248
1380
  ___
1249
1381
 
@@ -1266,7 +1398,7 @@ ___
1266
1398
 
1267
1399
  #### Defined in
1268
1400
 
1269
- [round.ts:6](https://github.com/daysnap/utils/blob/55f426c/src/round.ts#L6)
1401
+ [round.ts:6](https://github.com/daysnap/utils/blob/ce2c582/src/round.ts#L6)
1270
1402
 
1271
1403
  ___
1272
1404
 
@@ -1289,7 +1421,30 @@ ___
1289
1421
 
1290
1422
  #### Defined in
1291
1423
 
1292
- [sleep.ts:4](https://github.com/daysnap/utils/blob/55f426c/src/sleep.ts#L4)
1424
+ [sleep.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/sleep.ts#L4)
1425
+
1426
+ ___
1427
+
1428
+ ### stringTrim
1429
+
1430
+ ▸ **stringTrim**(`str`, `type?`): `string`
1431
+
1432
+ 去除字符串空格
1433
+
1434
+ #### Parameters
1435
+
1436
+ | Name | Type |
1437
+ | :------ | :------ |
1438
+ | `str` | `string` |
1439
+ | `type?` | ``1`` \| ``2`` \| ``3`` \| ``4`` |
1440
+
1441
+ #### Returns
1442
+
1443
+ `string`
1444
+
1445
+ #### Defined in
1446
+
1447
+ [stringTrim.ts:4](https://github.com/daysnap/utils/blob/ce2c582/src/stringTrim.ts#L4)
1293
1448
 
1294
1449
  ___
1295
1450
 
@@ -1311,4 +1466,34 @@ ___
1311
1466
 
1312
1467
  #### Defined in
1313
1468
 
1314
- [stringifyQuery.ts:6](https://github.com/daysnap/utils/blob/55f426c/src/stringifyQuery.ts#L6)
1469
+ [stringifyQuery.ts:6](https://github.com/daysnap/utils/blob/ce2c582/src/stringifyQuery.ts#L6)
1470
+
1471
+ ___
1472
+
1473
+ ### typeOf
1474
+
1475
+ ▸ **typeOf**<`T`\>(`val`): val is T
1476
+
1477
+ 判断类型
1478
+
1479
+ #### Type parameters
1480
+
1481
+ | Name |
1482
+ | :------ |
1483
+ | `T` |
1484
+
1485
+ #### Parameters
1486
+
1487
+ | Name | Type | Description |
1488
+ | :------ | :------ | :------ |
1489
+ | `val` | `T` | 待判断数据 |
1490
+
1491
+ #### Returns
1492
+
1493
+ val is T
1494
+
1495
+ 'undefined'|'null'|'boolean'|'string'|'number'|'object'|'array'|'function'|'symbol'|'map'|'weakmap'|'bigint'|'regexp'|'date'
1496
+
1497
+ #### Defined in
1498
+
1499
+ [typeOf.ts:6](https://github.com/daysnap/utils/blob/ce2c582/src/typeOf.ts#L6)
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 替换字符串里面的回车换行符
3
+ */
4
+ export declare function filterCRLF(v: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 替换字符串里面的回车换行符
3
+ */
4
+ export function filterCRLF(v) {
5
+ return v.replace(/\r|\n/gi, '<br/>');
6
+ }
@@ -17,5 +17,6 @@ export function getBlobByUrl(url) {
17
17
  reject(new Error("".concat(statusText, "[").concat(status, "]")));
18
18
  }
19
19
  };
20
+ xhr.send();
20
21
  });
21
22
  }