@daysnap/utils 0.0.78 → 0.0.79

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.
@@ -35,7 +35,7 @@
35
35
 
36
36
  #### Defined in
37
37
 
38
- [storage/factory.ts:3](https://github.com/daysnap/utils/blob/acb36e3/src/storage/factory.ts#L3)
38
+ [storage/factory.ts:3](https://github.com/daysnap/utils/blob/3253702/src/storage/factory.ts#L3)
39
39
 
40
40
  ___
41
41
 
@@ -49,7 +49,7 @@ ___
49
49
 
50
50
  #### Defined in
51
51
 
52
- [storage/factory.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/storage/factory.ts#L4)
52
+ [storage/factory.ts:4](https://github.com/daysnap/utils/blob/3253702/src/storage/factory.ts#L4)
53
53
 
54
54
  ___
55
55
 
@@ -69,7 +69,7 @@ ___
69
69
 
70
70
  #### Defined in
71
71
 
72
- [storage/factory.ts:2](https://github.com/daysnap/utils/blob/acb36e3/src/storage/factory.ts#L2)
72
+ [storage/factory.ts:2](https://github.com/daysnap/utils/blob/3253702/src/storage/factory.ts#L2)
73
73
 
74
74
  ___
75
75
 
@@ -89,4 +89,4 @@ ___
89
89
 
90
90
  #### Defined in
91
91
 
92
- [storage/factory.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/storage/factory.ts#L5)
92
+ [storage/factory.ts:5](https://github.com/daysnap/utils/blob/3253702/src/storage/factory.ts#L5)
@@ -31,7 +31,7 @@
31
31
 
32
32
  #### Defined in
33
33
 
34
- [trap.ts:12](https://github.com/daysnap/utils/blob/acb36e3/src/trap.ts#L12)
34
+ [trap.ts:12](https://github.com/daysnap/utils/blob/3253702/src/trap.ts#L12)
35
35
 
36
36
  ___
37
37
 
@@ -56,7 +56,7 @@ ___
56
56
 
57
57
  #### Defined in
58
58
 
59
- [trap.ts:10](https://github.com/daysnap/utils/blob/acb36e3/src/trap.ts#L10)
59
+ [trap.ts:10](https://github.com/daysnap/utils/blob/3253702/src/trap.ts#L10)
60
60
 
61
61
  ___
62
62
 
@@ -80,7 +80,7 @@ ___
80
80
 
81
81
  #### Defined in
82
82
 
83
- [trap.ts:11](https://github.com/daysnap/utils/blob/acb36e3/src/trap.ts#L11)
83
+ [trap.ts:11](https://github.com/daysnap/utils/blob/3253702/src/trap.ts#L11)
84
84
 
85
85
  ___
86
86
 
@@ -90,7 +90,7 @@ ___
90
90
 
91
91
  #### Defined in
92
92
 
93
- [trap.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/trap.ts#L8)
93
+ [trap.ts:8](https://github.com/daysnap/utils/blob/3253702/src/trap.ts#L8)
94
94
 
95
95
  ___
96
96
 
@@ -115,4 +115,4 @@ ___
115
115
 
116
116
  #### Defined in
117
117
 
118
- [trap.ts:9](https://github.com/daysnap/utils/blob/acb36e3/src/trap.ts#L9)
118
+ [trap.ts:9](https://github.com/daysnap/utils/blob/3253702/src/trap.ts#L9)
package/docs/modules.md CHANGED
@@ -28,6 +28,7 @@
28
28
  - [colorGenByHash](modules.md#colorgenbyhash)
29
29
  - [compareVersion](modules.md#compareversion)
30
30
  - [compressImage](modules.md#compressimage)
31
+ - [createTrapInstance](modules.md#createtrapinstance)
31
32
  - [createWithLoading](modules.md#createwithloading)
32
33
  - [debounce](modules.md#debounce)
33
34
  - [downloadFile](modules.md#downloadfile)
@@ -129,7 +130,7 @@
129
130
 
130
131
  #### Defined in
131
132
 
132
- [trap.ts:15](https://github.com/daysnap/utils/blob/acb36e3/src/trap.ts#L15)
133
+ [trap.ts:15](https://github.com/daysnap/utils/blob/3253702/src/trap.ts#L15)
133
134
 
134
135
  ## Functions
135
136
 
@@ -167,7 +168,7 @@ res = { '1': '男', '2': '女' }
167
168
 
168
169
  #### Defined in
169
170
 
170
- [ato.ts:12](https://github.com/daysnap/utils/blob/acb36e3/src/ato.ts#L12)
171
+ [ato.ts:12](https://github.com/daysnap/utils/blob/3253702/src/ato.ts#L12)
171
172
 
172
173
  ▸ **ato**<`T`, `K`\>(`options`, `labelKey`, `valueKey`): `Record`<`T`[`K`], `any`\>
173
174
 
@@ -192,7 +193,7 @@ res = { '1': '男', '2': '女' }
192
193
 
193
194
  #### Defined in
194
195
 
195
- [ato.ts:16](https://github.com/daysnap/utils/blob/acb36e3/src/ato.ts#L16)
196
+ [ato.ts:16](https://github.com/daysnap/utils/blob/3253702/src/ato.ts#L16)
196
197
 
197
198
  ___
198
199
 
@@ -215,7 +216,7 @@ base64 转 blob
215
216
 
216
217
  #### Defined in
217
218
 
218
- [base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/base64ToBlob.ts#L6)
219
+ [base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/3253702/src/base64ToBlob.ts#L6)
219
220
 
220
221
  ___
221
222
 
@@ -237,7 +238,7 @@ blob 转 base64
237
238
 
238
239
  #### Defined in
239
240
 
240
- [blobToBase64.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/blobToBase64.ts#L4)
241
+ [blobToBase64.ts:4](https://github.com/daysnap/utils/blob/3253702/src/blobToBase64.ts#L4)
241
242
 
242
243
  ___
243
244
 
@@ -278,7 +279,7 @@ ___
278
279
 
279
280
  #### Defined in
280
281
 
281
- [cached.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/cached.ts#L5)
282
+ [cached.ts:5](https://github.com/daysnap/utils/blob/3253702/src/cached.ts#L5)
282
283
 
283
284
  ___
284
285
 
@@ -301,7 +302,7 @@ camelCase('hello-world') => helloWorld
301
302
 
302
303
  #### Defined in
303
304
 
304
- [camelCase.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/camelCase.ts#L5)
305
+ [camelCase.ts:5](https://github.com/daysnap/utils/blob/3253702/src/camelCase.ts#L5)
305
306
 
306
307
  ___
307
308
 
@@ -325,7 +326,7 @@ canvas 转 blob 文件
325
326
 
326
327
  #### Defined in
327
328
 
328
- [canvasToBlob.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/canvasToBlob.ts#L4)
329
+ [canvasToBlob.ts:4](https://github.com/daysnap/utils/blob/3253702/src/canvasToBlob.ts#L4)
329
330
 
330
331
  ___
331
332
 
@@ -348,7 +349,7 @@ capitalize('hello world') => Hello world
348
349
 
349
350
  #### Defined in
350
351
 
351
- [capitalize.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/capitalize.ts#L5)
352
+ [capitalize.ts:5](https://github.com/daysnap/utils/blob/3253702/src/capitalize.ts#L5)
352
353
 
353
354
  ___
354
355
 
@@ -372,7 +373,7 @@ ___
372
373
 
373
374
  #### Defined in
374
375
 
375
- [clamp.ts:7](https://github.com/daysnap/utils/blob/acb36e3/src/clamp.ts#L7)
376
+ [clamp.ts:7](https://github.com/daysnap/utils/blob/3253702/src/clamp.ts#L7)
376
377
 
377
378
  ___
378
379
 
@@ -400,7 +401,7 @@ ___
400
401
 
401
402
  #### Defined in
402
403
 
403
- [clone.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/clone.ts#L8)
404
+ [clone.ts:8](https://github.com/daysnap/utils/blob/3253702/src/clone.ts#L8)
404
405
 
405
406
  ___
406
407
 
@@ -428,7 +429,7 @@ ___
428
429
 
429
430
  #### Defined in
430
431
 
431
- [cloneSimple.ts:7](https://github.com/daysnap/utils/blob/acb36e3/src/cloneSimple.ts#L7)
432
+ [cloneSimple.ts:7](https://github.com/daysnap/utils/blob/3253702/src/cloneSimple.ts#L7)
432
433
 
433
434
  ___
434
435
 
@@ -450,7 +451,7 @@ ___
450
451
 
451
452
  #### Defined in
452
453
 
453
- [createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/createHexColorByHash.ts#L4)
454
+ [createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/3253702/src/createHexColorByHash.ts#L4)
454
455
 
455
456
  ___
456
457
 
@@ -476,7 +477,7 @@ ___
476
477
 
477
478
  #### Defined in
478
479
 
479
- [compareVersion.ts:9](https://github.com/daysnap/utils/blob/acb36e3/src/compareVersion.ts#L9)
480
+ [compareVersion.ts:9](https://github.com/daysnap/utils/blob/3253702/src/compareVersion.ts#L9)
480
481
 
481
482
  ___
482
483
 
@@ -498,7 +499,39 @@ ___
498
499
 
499
500
  #### Defined in
500
501
 
501
- [compressImage.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/compressImage.ts#L6)
502
+ [compressImage.ts:6](https://github.com/daysnap/utils/blob/3253702/src/compressImage.ts#L6)
503
+
504
+ ___
505
+
506
+ ### createTrapInstance
507
+
508
+ ▸ **createTrapInstance**<`T`\>(`id`): `Object`
509
+
510
+ #### Type parameters
511
+
512
+ | Name | Type |
513
+ | :------ | :------ |
514
+ | `T` | `any` |
515
+
516
+ #### Parameters
517
+
518
+ | Name | Type |
519
+ | :------ | :------ |
520
+ | `id` | `string` |
521
+
522
+ #### Returns
523
+
524
+ `Object`
525
+
526
+ | Name | Type |
527
+ | :------ | :------ |
528
+ | `create` | (`cb`: (`data`: `T`) => `void`) => `void` |
529
+ | `delete` | () => `void` |
530
+ | `trigger` | (`data?`: `T`) => `void` |
531
+
532
+ #### Defined in
533
+
534
+ [trap.ts:49](https://github.com/daysnap/utils/blob/3253702/src/trap.ts#L49)
502
535
 
503
536
  ___
504
537
 
@@ -561,7 +594,7 @@ fn() 执行的时候就会执行showLoading
561
594
 
562
595
  #### Defined in
563
596
 
564
- [createWithLoading.ts:9](https://github.com/daysnap/utils/blob/acb36e3/src/createWithLoading.ts#L9)
597
+ [createWithLoading.ts:9](https://github.com/daysnap/utils/blob/3253702/src/createWithLoading.ts#L9)
565
598
 
566
599
  ___
567
600
 
@@ -604,7 +637,7 @@ ___
604
637
 
605
638
  #### Defined in
606
639
 
607
- [debounce.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/debounce.ts#L5)
640
+ [debounce.ts:5](https://github.com/daysnap/utils/blob/3253702/src/debounce.ts#L5)
608
641
 
609
642
  ___
610
643
 
@@ -628,7 +661,7 @@ ___
628
661
 
629
662
  #### Defined in
630
663
 
631
- [downloadFile.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/downloadFile.ts#L4)
664
+ [downloadFile.ts:4](https://github.com/daysnap/utils/blob/3253702/src/downloadFile.ts#L4)
632
665
 
633
666
  ___
634
667
 
@@ -657,7 +690,7 @@ ___
657
690
 
658
691
  #### Defined in
659
692
 
660
- [each.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/each.ts#L4)
693
+ [each.ts:4](https://github.com/daysnap/utils/blob/3253702/src/each.ts#L4)
661
694
 
662
695
  ▸ **each**<`T`\>(`data`, `callback`): `void`
663
696
 
@@ -680,7 +713,7 @@ ___
680
713
 
681
714
  #### Defined in
682
715
 
683
- [each.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/each.ts#L8)
716
+ [each.ts:8](https://github.com/daysnap/utils/blob/3253702/src/each.ts#L8)
684
717
 
685
718
  ___
686
719
 
@@ -698,7 +731,7 @@ ___
698
731
 
699
732
  #### Defined in
700
733
 
701
- [exitFullscreen.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/exitFullscreen.ts#L6)
734
+ [exitFullscreen.ts:6](https://github.com/daysnap/utils/blob/3253702/src/exitFullscreen.ts#L6)
702
735
 
703
736
  ___
704
737
 
@@ -727,7 +760,7 @@ ___
727
760
 
728
761
  #### Defined in
729
762
 
730
- [storage/factory.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/storage/factory.ts#L8)
763
+ [storage/factory.ts:8](https://github.com/daysnap/utils/blob/3253702/src/storage/factory.ts#L8)
731
764
 
732
765
  ___
733
766
 
@@ -749,7 +782,7 @@ ___
749
782
 
750
783
  #### Defined in
751
784
 
752
- [filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/filterBankCardNo.ts#L4)
785
+ [filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/3253702/src/filterBankCardNo.ts#L4)
753
786
 
754
787
  ___
755
788
 
@@ -771,7 +804,7 @@ ___
771
804
 
772
805
  #### Defined in
773
806
 
774
- [filterCRLF.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/filterCRLF.ts#L4)
807
+ [filterCRLF.ts:4](https://github.com/daysnap/utils/blob/3253702/src/filterCRLF.ts#L4)
775
808
 
776
809
  ___
777
810
 
@@ -793,7 +826,7 @@ ___
793
826
 
794
827
  #### Defined in
795
828
 
796
- [filterEmoji.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/filterEmoji.ts#L4)
829
+ [filterEmoji.ts:4](https://github.com/daysnap/utils/blob/3253702/src/filterEmoji.ts#L4)
797
830
 
798
831
  ___
799
832
 
@@ -816,7 +849,7 @@ ___
816
849
 
817
850
  #### Defined in
818
851
 
819
- [filterEmptyValue.ts:12](https://github.com/daysnap/utils/blob/acb36e3/src/filterEmptyValue.ts#L12)
852
+ [filterEmptyValue.ts:12](https://github.com/daysnap/utils/blob/3253702/src/filterEmptyValue.ts#L12)
820
853
 
821
854
  ___
822
855
 
@@ -839,7 +872,7 @@ ___
839
872
 
840
873
  #### Defined in
841
874
 
842
- [filterIdCard.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/filterIdCard.ts#L5)
875
+ [filterIdCard.ts:5](https://github.com/daysnap/utils/blob/3253702/src/filterIdCard.ts#L5)
843
876
 
844
877
  ___
845
878
 
@@ -861,7 +894,7 @@ ___
861
894
 
862
895
  #### Defined in
863
896
 
864
- [filterName.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/filterName.ts#L4)
897
+ [filterName.ts:4](https://github.com/daysnap/utils/blob/3253702/src/filterName.ts#L4)
865
898
 
866
899
  ___
867
900
 
@@ -886,7 +919,7 @@ filterPhone('13177778888', ' ') => 131 **** 8888
886
919
 
887
920
  #### Defined in
888
921
 
889
- [filterPhone.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/filterPhone.ts#L6)
922
+ [filterPhone.ts:6](https://github.com/daysnap/utils/blob/3253702/src/filterPhone.ts#L6)
890
923
 
891
924
  ___
892
925
 
@@ -913,7 +946,7 @@ str = '131****8888'
913
946
 
914
947
  #### Defined in
915
948
 
916
- [filterString.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/filterString.ts#L6)
949
+ [filterString.ts:6](https://github.com/daysnap/utils/blob/3253702/src/filterString.ts#L6)
917
950
 
918
951
  ___
919
952
 
@@ -936,7 +969,7 @@ ___
936
969
 
937
970
  #### Defined in
938
971
 
939
- [formatAmount.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/formatAmount.ts#L4)
972
+ [formatAmount.ts:4](https://github.com/daysnap/utils/blob/3253702/src/formatAmount.ts#L4)
940
973
 
941
974
  ___
942
975
 
@@ -960,7 +993,7 @@ ___
960
993
 
961
994
  #### Defined in
962
995
 
963
- [formatDate.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/formatDate.ts#L8)
996
+ [formatDate.ts:8](https://github.com/daysnap/utils/blob/3253702/src/formatDate.ts#L8)
964
997
 
965
998
  ___
966
999
 
@@ -983,7 +1016,7 @@ fix iOS 日期时间格式如果是 - 就会报错的问题
983
1016
 
984
1017
  #### Defined in
985
1018
 
986
- [formatDateStr.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/formatDateStr.ts#L5)
1019
+ [formatDateStr.ts:5](https://github.com/daysnap/utils/blob/3253702/src/formatDateStr.ts#L5)
987
1020
 
988
1021
  ___
989
1022
 
@@ -1008,7 +1041,7 @@ formatMessage({ a: '123', b: { ba: '456' } }, ['b.ba']) => '456'
1008
1041
 
1009
1042
  #### Defined in
1010
1043
 
1011
- [formatMessage.ts:11](https://github.com/daysnap/utils/blob/acb36e3/src/formatMessage.ts#L11)
1044
+ [formatMessage.ts:11](https://github.com/daysnap/utils/blob/3253702/src/formatMessage.ts#L11)
1012
1045
 
1013
1046
  ___
1014
1047
 
@@ -1040,7 +1073,7 @@ rest = { xxx: 1 }
1040
1073
 
1041
1074
  #### Defined in
1042
1075
 
1043
- [formatPathParams.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/formatPathParams.ts#L8)
1076
+ [formatPathParams.ts:8](https://github.com/daysnap/utils/blob/3253702/src/formatPathParams.ts#L8)
1044
1077
 
1045
1078
  ___
1046
1079
 
@@ -1062,7 +1095,7 @@ ___
1062
1095
 
1063
1096
  #### Defined in
1064
1097
 
1065
- [getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/getBlobByUrl.ts#L4)
1098
+ [getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/3253702/src/getBlobByUrl.ts#L4)
1066
1099
 
1067
1100
  ___
1068
1101
 
@@ -1085,7 +1118,7 @@ ___
1085
1118
 
1086
1119
  #### Defined in
1087
1120
 
1088
- [storage/index.ts:9](https://github.com/daysnap/utils/blob/acb36e3/src/storage/index.ts#L9)
1121
+ [storage/index.ts:9](https://github.com/daysnap/utils/blob/3253702/src/storage/index.ts#L9)
1089
1122
 
1090
1123
  ___
1091
1124
 
@@ -1107,7 +1140,7 @@ ___
1107
1140
 
1108
1141
  #### Defined in
1109
1142
 
1110
- [getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/getDayMillisecond.ts#L4)
1143
+ [getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/3253702/src/getDayMillisecond.ts#L4)
1111
1144
 
1112
1145
  ___
1113
1146
 
@@ -1129,7 +1162,7 @@ ___
1129
1162
 
1130
1163
  #### Defined in
1131
1164
 
1132
- [getImageInfo.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/getImageInfo.ts#L4)
1165
+ [getImageInfo.ts:4](https://github.com/daysnap/utils/blob/3253702/src/getImageInfo.ts#L4)
1133
1166
 
1134
1167
  ___
1135
1168
 
@@ -1152,7 +1185,7 @@ ___
1152
1185
 
1153
1186
  #### Defined in
1154
1187
 
1155
- [storage/index.ts:9](https://github.com/daysnap/utils/blob/acb36e3/src/storage/index.ts#L9)
1188
+ [storage/index.ts:9](https://github.com/daysnap/utils/blob/3253702/src/storage/index.ts#L9)
1156
1189
 
1157
1190
  ___
1158
1191
 
@@ -1175,7 +1208,7 @@ ___
1175
1208
 
1176
1209
  #### Defined in
1177
1210
 
1178
- [getRandom.ts:7](https://github.com/daysnap/utils/blob/acb36e3/src/getRandom.ts#L7)
1211
+ [getRandom.ts:7](https://github.com/daysnap/utils/blob/3253702/src/getRandom.ts#L7)
1179
1212
 
1180
1213
  ___
1181
1214
 
@@ -1191,7 +1224,7 @@ ___
1191
1224
 
1192
1225
  #### Defined in
1193
1226
 
1194
- [getRandomColor.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/getRandomColor.ts#L4)
1227
+ [getRandomColor.ts:4](https://github.com/daysnap/utils/blob/3253702/src/getRandomColor.ts#L4)
1195
1228
 
1196
1229
  ___
1197
1230
 
@@ -1213,7 +1246,7 @@ ___
1213
1246
 
1214
1247
  #### Defined in
1215
1248
 
1216
- [getRandomNumber.ts:7](https://github.com/daysnap/utils/blob/acb36e3/src/getRandomNumber.ts#L7)
1249
+ [getRandomNumber.ts:7](https://github.com/daysnap/utils/blob/3253702/src/getRandomNumber.ts#L7)
1217
1250
 
1218
1251
  ___
1219
1252
 
@@ -1235,7 +1268,7 @@ ___
1235
1268
 
1236
1269
  #### Defined in
1237
1270
 
1238
- [getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/getVideoInfo.ts#L4)
1271
+ [getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/3253702/src/getVideoInfo.ts#L4)
1239
1272
 
1240
1273
  ___
1241
1274
 
@@ -1251,7 +1284,7 @@ ___
1251
1284
 
1252
1285
  #### Defined in
1253
1286
 
1254
- [inBrowser.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/inBrowser.ts#L4)
1287
+ [inBrowser.ts:4](https://github.com/daysnap/utils/blob/3253702/src/inBrowser.ts#L4)
1255
1288
 
1256
1289
  ___
1257
1290
 
@@ -1273,7 +1306,7 @@ ___
1273
1306
 
1274
1307
  #### Defined in
1275
1308
 
1276
- [insertLink.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/insertLink.ts#L4)
1309
+ [insertLink.ts:4](https://github.com/daysnap/utils/blob/3253702/src/insertLink.ts#L4)
1277
1310
 
1278
1311
  ▸ **insertLink**(`href`, `callback`): `void`
1279
1312
 
@@ -1290,7 +1323,7 @@ ___
1290
1323
 
1291
1324
  #### Defined in
1292
1325
 
1293
- [insertLink.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/insertLink.ts#L5)
1326
+ [insertLink.ts:5](https://github.com/daysnap/utils/blob/3253702/src/insertLink.ts#L5)
1294
1327
 
1295
1328
  ___
1296
1329
 
@@ -1312,7 +1345,7 @@ ___
1312
1345
 
1313
1346
  #### Defined in
1314
1347
 
1315
- [insertScript.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/insertScript.ts#L4)
1348
+ [insertScript.ts:4](https://github.com/daysnap/utils/blob/3253702/src/insertScript.ts#L4)
1316
1349
 
1317
1350
  ▸ **insertScript**(`src`, `callback`): `void`
1318
1351
 
@@ -1329,7 +1362,7 @@ ___
1329
1362
 
1330
1363
  #### Defined in
1331
1364
 
1332
- [insertScript.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/insertScript.ts#L5)
1365
+ [insertScript.ts:5](https://github.com/daysnap/utils/blob/3253702/src/insertScript.ts#L5)
1333
1366
 
1334
1367
  ___
1335
1368
 
@@ -1351,7 +1384,7 @@ ___
1351
1384
 
1352
1385
  #### Defined in
1353
1386
 
1354
- [insertStyle.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/insertStyle.ts#L4)
1387
+ [insertStyle.ts:4](https://github.com/daysnap/utils/blob/3253702/src/insertStyle.ts#L4)
1355
1388
 
1356
1389
  ___
1357
1390
 
@@ -1380,7 +1413,7 @@ isAmount('1.123') => false
1380
1413
 
1381
1414
  #### Defined in
1382
1415
 
1383
- [isAmount.ts:11](https://github.com/daysnap/utils/blob/acb36e3/src/isAmount.ts#L11)
1416
+ [isAmount.ts:11](https://github.com/daysnap/utils/blob/3253702/src/isAmount.ts#L11)
1384
1417
 
1385
1418
  ___
1386
1419
 
@@ -1396,7 +1429,7 @@ ___
1396
1429
 
1397
1430
  #### Defined in
1398
1431
 
1399
- [isAndroid.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isAndroid.ts#L4)
1432
+ [isAndroid.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isAndroid.ts#L4)
1400
1433
 
1401
1434
  ___
1402
1435
 
@@ -1420,7 +1453,7 @@ val is any[]
1420
1453
 
1421
1454
  #### Defined in
1422
1455
 
1423
- [isArray.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/isArray.ts#L6)
1456
+ [isArray.ts:6](https://github.com/daysnap/utils/blob/3253702/src/isArray.ts#L6)
1424
1457
 
1425
1458
  ___
1426
1459
 
@@ -1442,7 +1475,7 @@ val is boolean
1442
1475
 
1443
1476
  #### Defined in
1444
1477
 
1445
- [isBoolean.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/isBoolean.ts#L5)
1478
+ [isBoolean.ts:5](https://github.com/daysnap/utils/blob/3253702/src/isBoolean.ts#L5)
1446
1479
 
1447
1480
  ___
1448
1481
 
@@ -1464,7 +1497,7 @@ ___
1464
1497
 
1465
1498
  #### Defined in
1466
1499
 
1467
- [isChinese.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isChinese.ts#L4)
1500
+ [isChinese.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isChinese.ts#L4)
1468
1501
 
1469
1502
  ___
1470
1503
 
@@ -1486,7 +1519,7 @@ val is Date
1486
1519
 
1487
1520
  #### Defined in
1488
1521
 
1489
- [isDate.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isDate.ts#L4)
1522
+ [isDate.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isDate.ts#L4)
1490
1523
 
1491
1524
  ___
1492
1525
 
@@ -1508,7 +1541,7 @@ ___
1508
1541
 
1509
1542
  #### Defined in
1510
1543
 
1511
- [isEmail.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isEmail.ts#L4)
1544
+ [isEmail.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isEmail.ts#L4)
1512
1545
 
1513
1546
  ___
1514
1547
 
@@ -1530,7 +1563,7 @@ ___
1530
1563
 
1531
1564
  #### Defined in
1532
1565
 
1533
- [isEmpty.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/isEmpty.ts#L6)
1566
+ [isEmpty.ts:6](https://github.com/daysnap/utils/blob/3253702/src/isEmpty.ts#L6)
1534
1567
 
1535
1568
  ___
1536
1569
 
@@ -1552,7 +1585,7 @@ ___
1552
1585
 
1553
1586
  #### Defined in
1554
1587
 
1555
- [isEmptyArray.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/isEmptyArray.ts#L6)
1588
+ [isEmptyArray.ts:6](https://github.com/daysnap/utils/blob/3253702/src/isEmptyArray.ts#L6)
1556
1589
 
1557
1590
  ___
1558
1591
 
@@ -1574,7 +1607,7 @@ ___
1574
1607
 
1575
1608
  #### Defined in
1576
1609
 
1577
- [isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/isEmptyObject.ts#L5)
1610
+ [isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/3253702/src/isEmptyObject.ts#L5)
1578
1611
 
1579
1612
  ___
1580
1613
 
@@ -1596,7 +1629,7 @@ val is Error
1596
1629
 
1597
1630
  #### Defined in
1598
1631
 
1599
- [isError.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isError.ts#L4)
1632
+ [isError.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isError.ts#L4)
1600
1633
 
1601
1634
  ___
1602
1635
 
@@ -1618,7 +1651,7 @@ val is Function
1618
1651
 
1619
1652
  #### Defined in
1620
1653
 
1621
- [isFunction.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isFunction.ts#L4)
1654
+ [isFunction.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isFunction.ts#L4)
1622
1655
 
1623
1656
  ___
1624
1657
 
@@ -1636,7 +1669,7 @@ ___
1636
1669
 
1637
1670
  #### Defined in
1638
1671
 
1639
- [isIE.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/isIE.ts#L6)
1672
+ [isIE.ts:6](https://github.com/daysnap/utils/blob/3253702/src/isIE.ts#L6)
1640
1673
 
1641
1674
  ___
1642
1675
 
@@ -1652,7 +1685,7 @@ ___
1652
1685
 
1653
1686
  #### Defined in
1654
1687
 
1655
- [isIOS.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isIOS.ts#L4)
1688
+ [isIOS.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isIOS.ts#L4)
1656
1689
 
1657
1690
  ___
1658
1691
 
@@ -1674,7 +1707,7 @@ ___
1674
1707
 
1675
1708
  #### Defined in
1676
1709
 
1677
- [isIdCard.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isIdCard.ts#L4)
1710
+ [isIdCard.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isIdCard.ts#L4)
1678
1711
 
1679
1712
  ___
1680
1713
 
@@ -1696,7 +1729,7 @@ ___
1696
1729
 
1697
1730
  #### Defined in
1698
1731
 
1699
- [isJSONString.ts:7](https://github.com/daysnap/utils/blob/acb36e3/src/isJSONString.ts#L7)
1732
+ [isJSONString.ts:7](https://github.com/daysnap/utils/blob/3253702/src/isJSONString.ts#L7)
1700
1733
 
1701
1734
  ___
1702
1735
 
@@ -1718,7 +1751,7 @@ ___
1718
1751
 
1719
1752
  #### Defined in
1720
1753
 
1721
- [isLan.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/isLan.ts#L5)
1754
+ [isLan.ts:5](https://github.com/daysnap/utils/blob/3253702/src/isLan.ts#L5)
1722
1755
 
1723
1756
  ___
1724
1757
 
@@ -1740,7 +1773,7 @@ ___
1740
1773
 
1741
1774
  #### Defined in
1742
1775
 
1743
- [isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/isLicenseCode.ts#L5)
1776
+ [isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/3253702/src/isLicenseCode.ts#L5)
1744
1777
 
1745
1778
  ___
1746
1779
 
@@ -1756,7 +1789,7 @@ ___
1756
1789
 
1757
1790
  #### Defined in
1758
1791
 
1759
- [isMobile.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isMobile.ts#L4)
1792
+ [isMobile.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isMobile.ts#L4)
1760
1793
 
1761
1794
  ___
1762
1795
 
@@ -1779,7 +1812,7 @@ ___
1779
1812
 
1780
1813
  #### Defined in
1781
1814
 
1782
- [isNativeFunction.ts:7](https://github.com/daysnap/utils/blob/acb36e3/src/isNativeFunction.ts#L7)
1815
+ [isNativeFunction.ts:7](https://github.com/daysnap/utils/blob/3253702/src/isNativeFunction.ts#L7)
1783
1816
 
1784
1817
  ___
1785
1818
 
@@ -1801,7 +1834,7 @@ val is null
1801
1834
 
1802
1835
  #### Defined in
1803
1836
 
1804
- [isNull.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isNull.ts#L4)
1837
+ [isNull.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isNull.ts#L4)
1805
1838
 
1806
1839
  ___
1807
1840
 
@@ -1823,7 +1856,7 @@ val is number
1823
1856
 
1824
1857
  #### Defined in
1825
1858
 
1826
- [isNumber.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/isNumber.ts#L5)
1859
+ [isNumber.ts:5](https://github.com/daysnap/utils/blob/3253702/src/isNumber.ts#L5)
1827
1860
 
1828
1861
  ___
1829
1862
 
@@ -1845,7 +1878,7 @@ val is Record<string, any\>
1845
1878
 
1846
1879
  #### Defined in
1847
1880
 
1848
- [isObject.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isObject.ts#L4)
1881
+ [isObject.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isObject.ts#L4)
1849
1882
 
1850
1883
  ___
1851
1884
 
@@ -1867,7 +1900,7 @@ ___
1867
1900
 
1868
1901
  #### Defined in
1869
1902
 
1870
- [isPhone.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isPhone.ts#L4)
1903
+ [isPhone.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isPhone.ts#L4)
1871
1904
 
1872
1905
  ___
1873
1906
 
@@ -1895,7 +1928,7 @@ val is Promise<T\>
1895
1928
 
1896
1929
  #### Defined in
1897
1930
 
1898
- [isPromise.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isPromise.ts#L4)
1931
+ [isPromise.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isPromise.ts#L4)
1899
1932
 
1900
1933
  ___
1901
1934
 
@@ -1917,7 +1950,7 @@ val is RegExp
1917
1950
 
1918
1951
  #### Defined in
1919
1952
 
1920
- [isRegExp.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isRegExp.ts#L4)
1953
+ [isRegExp.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isRegExp.ts#L4)
1921
1954
 
1922
1955
  ___
1923
1956
 
@@ -1939,7 +1972,7 @@ val is string
1939
1972
 
1940
1973
  #### Defined in
1941
1974
 
1942
- [isString.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isString.ts#L4)
1975
+ [isString.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isString.ts#L4)
1943
1976
 
1944
1977
  ___
1945
1978
 
@@ -1961,7 +1994,7 @@ ___
1961
1994
 
1962
1995
  #### Defined in
1963
1996
 
1964
- [isURL.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isURL.ts#L4)
1997
+ [isURL.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isURL.ts#L4)
1965
1998
 
1966
1999
  ___
1967
2000
 
@@ -1983,7 +2016,7 @@ val is undefined
1983
2016
 
1984
2017
  #### Defined in
1985
2018
 
1986
- [isUndefined.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isUndefined.ts#L4)
2019
+ [isUndefined.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isUndefined.ts#L4)
1987
2020
 
1988
2021
  ___
1989
2022
 
@@ -1999,7 +2032,7 @@ ___
1999
2032
 
2000
2033
  #### Defined in
2001
2034
 
2002
- [isWeChat.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/isWeChat.ts#L4)
2035
+ [isWeChat.ts:4](https://github.com/daysnap/utils/blob/3253702/src/isWeChat.ts#L4)
2003
2036
 
2004
2037
  ___
2005
2038
 
@@ -2016,7 +2049,7 @@ https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html
2016
2049
 
2017
2050
  #### Defined in
2018
2051
 
2019
- [isWeChatMiniProgram.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/isWeChatMiniProgram.ts#L5)
2052
+ [isWeChatMiniProgram.ts:5](https://github.com/daysnap/utils/blob/3253702/src/isWeChatMiniProgram.ts#L5)
2020
2053
 
2021
2054
  ___
2022
2055
 
@@ -2036,7 +2069,7 @@ ___
2036
2069
 
2037
2070
  #### Defined in
2038
2071
 
2039
- [isWeChat.ts:12](https://github.com/daysnap/utils/blob/acb36e3/src/isWeChat.ts#L12)
2072
+ [isWeChat.ts:12](https://github.com/daysnap/utils/blob/3253702/src/isWeChat.ts#L12)
2040
2073
 
2041
2074
  ___
2042
2075
 
@@ -2058,7 +2091,7 @@ val is Window
2058
2091
 
2059
2092
  #### Defined in
2060
2093
 
2061
- [isWindow.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/isWindow.ts#L5)
2094
+ [isWindow.ts:5](https://github.com/daysnap/utils/blob/3253702/src/isWindow.ts#L5)
2062
2095
 
2063
2096
  ___
2064
2097
 
@@ -2081,7 +2114,7 @@ kebabCase('helloWorld') => hello-world
2081
2114
 
2082
2115
  #### Defined in
2083
2116
 
2084
- [kebabCase.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/kebabCase.ts#L5)
2117
+ [kebabCase.ts:5](https://github.com/daysnap/utils/blob/3253702/src/kebabCase.ts#L5)
2085
2118
 
2086
2119
  ___
2087
2120
 
@@ -2110,7 +2143,7 @@ list 生成器,快速生成数据
2110
2143
 
2111
2144
  #### Defined in
2112
2145
 
2113
- [listGenerator.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/listGenerator.ts#L5)
2146
+ [listGenerator.ts:5](https://github.com/daysnap/utils/blob/3253702/src/listGenerator.ts#L5)
2114
2147
 
2115
2148
  ___
2116
2149
 
@@ -2135,7 +2168,7 @@ ___
2135
2168
 
2136
2169
  #### Defined in
2137
2170
 
2138
- [mousewheel.ts:22](https://github.com/daysnap/utils/blob/acb36e3/src/mousewheel.ts#L22)
2171
+ [mousewheel.ts:22](https://github.com/daysnap/utils/blob/3253702/src/mousewheel.ts#L22)
2139
2172
 
2140
2173
  ___
2141
2174
 
@@ -2157,7 +2190,7 @@ ___
2157
2190
 
2158
2191
  #### Defined in
2159
2192
 
2160
- [normalizePath.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/normalizePath.ts#L4)
2193
+ [normalizePath.ts:4](https://github.com/daysnap/utils/blob/3253702/src/normalizePath.ts#L4)
2161
2194
 
2162
2195
  ___
2163
2196
 
@@ -2187,7 +2220,7 @@ ___
2187
2220
 
2188
2221
  #### Defined in
2189
2222
 
2190
- [omit.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/omit.ts#L4)
2223
+ [omit.ts:4](https://github.com/daysnap/utils/blob/3253702/src/omit.ts#L4)
2191
2224
 
2192
2225
  ___
2193
2226
 
@@ -2211,7 +2244,7 @@ ___
2211
2244
 
2212
2245
  #### Defined in
2213
2246
 
2214
- [padding.ts:7](https://github.com/daysnap/utils/blob/acb36e3/src/padding.ts#L7)
2247
+ [padding.ts:7](https://github.com/daysnap/utils/blob/3253702/src/padding.ts#L7)
2215
2248
 
2216
2249
  ___
2217
2250
 
@@ -2233,7 +2266,7 @@ ___
2233
2266
 
2234
2267
  #### Defined in
2235
2268
 
2236
- [parseDate.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/parseDate.ts#L4)
2269
+ [parseDate.ts:4](https://github.com/daysnap/utils/blob/3253702/src/parseDate.ts#L4)
2237
2270
 
2238
2271
  ___
2239
2272
 
@@ -2256,7 +2289,7 @@ ___
2256
2289
 
2257
2290
  #### Defined in
2258
2291
 
2259
- [parseError.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/parseError.ts#L8)
2292
+ [parseError.ts:8](https://github.com/daysnap/utils/blob/3253702/src/parseError.ts#L8)
2260
2293
 
2261
2294
  ___
2262
2295
 
@@ -2286,7 +2319,7 @@ parseObject('a.b.c', 1) => { a: { b: { c: 1 } } }
2286
2319
 
2287
2320
  #### Defined in
2288
2321
 
2289
- [parseObject.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/parseObject.ts#L5)
2322
+ [parseObject.ts:5](https://github.com/daysnap/utils/blob/3253702/src/parseObject.ts#L5)
2290
2323
 
2291
2324
  ___
2292
2325
 
@@ -2315,7 +2348,7 @@ ___
2315
2348
 
2316
2349
  #### Defined in
2317
2350
 
2318
- [parsePath.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/parsePath.ts#L6)
2351
+ [parsePath.ts:6](https://github.com/daysnap/utils/blob/3253702/src/parsePath.ts#L6)
2319
2352
 
2320
2353
  ___
2321
2354
 
@@ -2338,7 +2371,7 @@ ___
2338
2371
 
2339
2372
  #### Defined in
2340
2373
 
2341
- [parseQuery.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/parseQuery.ts#L8)
2374
+ [parseQuery.ts:8](https://github.com/daysnap/utils/blob/3253702/src/parseQuery.ts#L8)
2342
2375
 
2343
2376
  ___
2344
2377
 
@@ -2361,7 +2394,7 @@ pascalCase('hello-world') => HelloWorld
2361
2394
 
2362
2395
  #### Defined in
2363
2396
 
2364
- [pascalCase.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/pascalCase.ts#L8)
2397
+ [pascalCase.ts:8](https://github.com/daysnap/utils/blob/3253702/src/pascalCase.ts#L8)
2365
2398
 
2366
2399
  ___
2367
2400
 
@@ -2391,7 +2424,7 @@ ___
2391
2424
 
2392
2425
  #### Defined in
2393
2426
 
2394
- [pick.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/pick.ts#L4)
2427
+ [pick.ts:4](https://github.com/daysnap/utils/blob/3253702/src/pick.ts#L4)
2395
2428
 
2396
2429
  ___
2397
2430
 
@@ -2414,7 +2447,7 @@ ___
2414
2447
 
2415
2448
  #### Defined in
2416
2449
 
2417
- [replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/replaceCrlf.ts#L4)
2450
+ [replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/3253702/src/replaceCrlf.ts#L4)
2418
2451
 
2419
2452
  ___
2420
2453
 
@@ -2438,7 +2471,7 @@ ___
2438
2471
 
2439
2472
  #### Defined in
2440
2473
 
2441
- [requestFullScreen.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/requestFullScreen.ts#L6)
2474
+ [requestFullScreen.ts:6](https://github.com/daysnap/utils/blob/3253702/src/requestFullScreen.ts#L6)
2442
2475
 
2443
2476
  ___
2444
2477
 
@@ -2464,7 +2497,7 @@ reserve(0, '--') => 0
2464
2497
 
2465
2498
  #### Defined in
2466
2499
 
2467
- [reserve.ts:8](https://github.com/daysnap/utils/blob/acb36e3/src/reserve.ts#L8)
2500
+ [reserve.ts:8](https://github.com/daysnap/utils/blob/3253702/src/reserve.ts#L8)
2468
2501
 
2469
2502
  ___
2470
2503
 
@@ -2488,7 +2521,7 @@ ___
2488
2521
 
2489
2522
  #### Defined in
2490
2523
 
2491
- [rgbToHex.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/rgbToHex.ts#L4)
2524
+ [rgbToHex.ts:4](https://github.com/daysnap/utils/blob/3253702/src/rgbToHex.ts#L4)
2492
2525
 
2493
2526
  ___
2494
2527
 
@@ -2511,7 +2544,7 @@ ___
2511
2544
 
2512
2545
  #### Defined in
2513
2546
 
2514
- [round.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/round.ts#L6)
2547
+ [round.ts:6](https://github.com/daysnap/utils/blob/3253702/src/round.ts#L6)
2515
2548
 
2516
2549
  ___
2517
2550
 
@@ -2527,7 +2560,7 @@ ___
2527
2560
 
2528
2561
  #### Defined in
2529
2562
 
2530
- [scrollToTop.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/scrollToTop.ts#L4)
2563
+ [scrollToTop.ts:4](https://github.com/daysnap/utils/blob/3253702/src/scrollToTop.ts#L4)
2531
2564
 
2532
2565
  ___
2533
2566
 
@@ -2550,7 +2583,7 @@ ___
2550
2583
 
2551
2584
  #### Defined in
2552
2585
 
2553
- [sleep.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/sleep.ts#L6)
2586
+ [sleep.ts:6](https://github.com/daysnap/utils/blob/3253702/src/sleep.ts#L6)
2554
2587
 
2555
2588
  ___
2556
2589
 
@@ -2579,7 +2612,7 @@ ___
2579
2612
 
2580
2613
  #### Defined in
2581
2614
 
2582
- [splitArray.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/splitArray.ts#L4)
2615
+ [splitArray.ts:4](https://github.com/daysnap/utils/blob/3253702/src/splitArray.ts#L4)
2583
2616
 
2584
2617
  ___
2585
2618
 
@@ -2602,7 +2635,7 @@ ___
2602
2635
 
2603
2636
  #### Defined in
2604
2637
 
2605
- [stringTrim.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/stringTrim.ts#L6)
2638
+ [stringTrim.ts:6](https://github.com/daysnap/utils/blob/3253702/src/stringTrim.ts#L6)
2606
2639
 
2607
2640
  ___
2608
2641
 
@@ -2624,7 +2657,7 @@ ___
2624
2657
 
2625
2658
  #### Defined in
2626
2659
 
2627
- [stringifyQuery.ts:7](https://github.com/daysnap/utils/blob/acb36e3/src/stringifyQuery.ts#L7)
2660
+ [stringifyQuery.ts:7](https://github.com/daysnap/utils/blob/3253702/src/stringifyQuery.ts#L7)
2628
2661
 
2629
2662
  ___
2630
2663
 
@@ -2667,7 +2700,7 @@ ___
2667
2700
 
2668
2701
  #### Defined in
2669
2702
 
2670
- [throttle.ts:5](https://github.com/daysnap/utils/blob/acb36e3/src/throttle.ts#L5)
2703
+ [throttle.ts:5](https://github.com/daysnap/utils/blob/3253702/src/throttle.ts#L5)
2671
2704
 
2672
2705
  ___
2673
2706
 
@@ -2689,7 +2722,7 @@ ___
2689
2722
 
2690
2723
  #### Defined in
2691
2724
 
2692
- [toCDB.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/toCDB.ts#L4)
2725
+ [toCDB.ts:4](https://github.com/daysnap/utils/blob/3253702/src/toCDB.ts#L4)
2693
2726
 
2694
2727
  ___
2695
2728
 
@@ -2711,7 +2744,7 @@ ___
2711
2744
 
2712
2745
  #### Defined in
2713
2746
 
2714
- [toDBC.ts:4](https://github.com/daysnap/utils/blob/acb36e3/src/toDBC.ts#L4)
2747
+ [toDBC.ts:4](https://github.com/daysnap/utils/blob/3253702/src/toDBC.ts#L4)
2715
2748
 
2716
2749
  ___
2717
2750
 
@@ -2735,4 +2768,4 @@ ___
2735
2768
 
2736
2769
  #### Defined in
2737
2770
 
2738
- [typeOf.ts:6](https://github.com/daysnap/utils/blob/acb36e3/src/typeOf.ts#L6)
2771
+ [typeOf.ts:6](https://github.com/daysnap/utils/blob/3253702/src/typeOf.ts#L6)
package/es/trap.d.ts CHANGED
@@ -10,3 +10,8 @@ export interface Trap {
10
10
  clear: () => void;
11
11
  }
12
12
  export declare const trap: Trap;
13
+ export declare function createTrapInstance<T = any>(id: string): {
14
+ trigger(data?: T): void;
15
+ create(cb: (data: T) => void): void;
16
+ delete(): void;
17
+ };
package/es/trap.js CHANGED
@@ -28,3 +28,16 @@ export const trap = {
28
28
  this.list = {};
29
29
  },
30
30
  };
31
+ export function createTrapInstance(id) {
32
+ return {
33
+ trigger(data) {
34
+ return trap.trigger(id, data);
35
+ },
36
+ create(cb) {
37
+ return trap.create(id, cb);
38
+ },
39
+ delete() {
40
+ return trap.delete(id);
41
+ },
42
+ };
43
+ }
package/lib/trap.d.ts CHANGED
@@ -10,3 +10,8 @@ export interface Trap {
10
10
  clear: () => void;
11
11
  }
12
12
  export declare const trap: Trap;
13
+ export declare function createTrapInstance<T = any>(id: string): {
14
+ trigger(data?: T): void;
15
+ create(cb: (data: T) => void): void;
16
+ delete(): void;
17
+ };
package/lib/trap.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.trap = void 0;
3
+ exports.createTrapInstance = exports.trap = void 0;
4
4
  const isUndefined_1 = require("./isUndefined");
5
5
  exports.trap = {
6
6
  list: {},
@@ -31,3 +31,17 @@ exports.trap = {
31
31
  this.list = {};
32
32
  },
33
33
  };
34
+ function createTrapInstance(id) {
35
+ return {
36
+ trigger(data) {
37
+ return exports.trap.trigger(id, data);
38
+ },
39
+ create(cb) {
40
+ return exports.trap.create(id, cb);
41
+ },
42
+ delete() {
43
+ return exports.trap.delete(id);
44
+ },
45
+ };
46
+ }
47
+ exports.createTrapInstance = createTrapInstance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daysnap/utils",
3
- "version": "0.0.78",
3
+ "version": "0.0.79",
4
4
  "description": "通用的工具库",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",