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