@daysnap/utils 0.0.38 → 0.0.39
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 +70 -70
- package/es/formatAmount.d.ts +1 -1
- package/es/formatAmount.js +1 -1
- package/es/parsePath.js +1 -2
- package/es/storage/factory.d.ts +5 -5
- package/es/storage/index.d.ts +10 -10
- package/lib/formatAmount.d.ts +1 -1
- package/lib/formatAmount.js +1 -1
- package/lib/parsePath.js +1 -2
- package/lib/storage/factory.d.ts +5 -5
- package/lib/storage/index.d.ts +10 -10
- package/package.json +1 -1
package/docs/modules.md
CHANGED
|
@@ -92,7 +92,7 @@ base64 转 blob
|
|
|
92
92
|
|
|
93
93
|
#### Defined in
|
|
94
94
|
|
|
95
|
-
[base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/
|
|
95
|
+
[base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/cd56451/src/base64ToBlob.ts#L6)
|
|
96
96
|
|
|
97
97
|
___
|
|
98
98
|
|
|
@@ -114,7 +114,7 @@ blob 转 base64
|
|
|
114
114
|
|
|
115
115
|
#### Defined in
|
|
116
116
|
|
|
117
|
-
[blobToBase64.ts:4](https://github.com/daysnap/utils/blob/
|
|
117
|
+
[blobToBase64.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/blobToBase64.ts#L4)
|
|
118
118
|
|
|
119
119
|
___
|
|
120
120
|
|
|
@@ -142,7 +142,7 @@ ___
|
|
|
142
142
|
|
|
143
143
|
#### Defined in
|
|
144
144
|
|
|
145
|
-
[clone.ts:7](https://github.com/daysnap/utils/blob/
|
|
145
|
+
[clone.ts:7](https://github.com/daysnap/utils/blob/cd56451/src/clone.ts#L7)
|
|
146
146
|
|
|
147
147
|
___
|
|
148
148
|
|
|
@@ -164,7 +164,7 @@ ___
|
|
|
164
164
|
|
|
165
165
|
#### Defined in
|
|
166
166
|
|
|
167
|
-
[createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/
|
|
167
|
+
[createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/createHexColorByHash.ts#L4)
|
|
168
168
|
|
|
169
169
|
___
|
|
170
170
|
|
|
@@ -190,7 +190,7 @@ ___
|
|
|
190
190
|
|
|
191
191
|
#### Defined in
|
|
192
192
|
|
|
193
|
-
[compareVersion.ts:9](https://github.com/daysnap/utils/blob/
|
|
193
|
+
[compareVersion.ts:9](https://github.com/daysnap/utils/blob/cd56451/src/compareVersion.ts#L9)
|
|
194
194
|
|
|
195
195
|
___
|
|
196
196
|
|
|
@@ -212,7 +212,7 @@ ___
|
|
|
212
212
|
|
|
213
213
|
#### Defined in
|
|
214
214
|
|
|
215
|
-
[compressImage.ts:6](https://github.com/daysnap/utils/blob/
|
|
215
|
+
[compressImage.ts:6](https://github.com/daysnap/utils/blob/cd56451/src/compressImage.ts#L6)
|
|
216
216
|
|
|
217
217
|
___
|
|
218
218
|
|
|
@@ -236,7 +236,7 @@ ___
|
|
|
236
236
|
|
|
237
237
|
#### Defined in
|
|
238
238
|
|
|
239
|
-
[downloadFile.ts:4](https://github.com/daysnap/utils/blob/
|
|
239
|
+
[downloadFile.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/downloadFile.ts#L4)
|
|
240
240
|
|
|
241
241
|
___
|
|
242
242
|
|
|
@@ -265,7 +265,7 @@ ___
|
|
|
265
265
|
|
|
266
266
|
#### Defined in
|
|
267
267
|
|
|
268
|
-
[each.ts:4](https://github.com/daysnap/utils/blob/
|
|
268
|
+
[each.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/each.ts#L4)
|
|
269
269
|
|
|
270
270
|
▸ **each**<`T`\>(`data`, `callback`): `void`
|
|
271
271
|
|
|
@@ -288,7 +288,7 @@ ___
|
|
|
288
288
|
|
|
289
289
|
#### Defined in
|
|
290
290
|
|
|
291
|
-
[each.ts:8](https://github.com/daysnap/utils/blob/
|
|
291
|
+
[each.ts:8](https://github.com/daysnap/utils/blob/cd56451/src/each.ts#L8)
|
|
292
292
|
|
|
293
293
|
___
|
|
294
294
|
|
|
@@ -310,7 +310,7 @@ ___
|
|
|
310
310
|
|
|
311
311
|
#### Defined in
|
|
312
312
|
|
|
313
|
-
[filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/
|
|
313
|
+
[filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/filterBankCardNo.ts#L4)
|
|
314
314
|
|
|
315
315
|
___
|
|
316
316
|
|
|
@@ -332,7 +332,7 @@ ___
|
|
|
332
332
|
|
|
333
333
|
#### Defined in
|
|
334
334
|
|
|
335
|
-
[filterCRLF.ts:4](https://github.com/daysnap/utils/blob/
|
|
335
|
+
[filterCRLF.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/filterCRLF.ts#L4)
|
|
336
336
|
|
|
337
337
|
___
|
|
338
338
|
|
|
@@ -354,7 +354,7 @@ ___
|
|
|
354
354
|
|
|
355
355
|
#### Defined in
|
|
356
356
|
|
|
357
|
-
[filterEmoji.ts:4](https://github.com/daysnap/utils/blob/
|
|
357
|
+
[filterEmoji.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/filterEmoji.ts#L4)
|
|
358
358
|
|
|
359
359
|
___
|
|
360
360
|
|
|
@@ -376,7 +376,7 @@ ___
|
|
|
376
376
|
|
|
377
377
|
#### Defined in
|
|
378
378
|
|
|
379
|
-
[filterIdCard.ts:4](https://github.com/daysnap/utils/blob/
|
|
379
|
+
[filterIdCard.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/filterIdCard.ts#L4)
|
|
380
380
|
|
|
381
381
|
___
|
|
382
382
|
|
|
@@ -398,7 +398,7 @@ ___
|
|
|
398
398
|
|
|
399
399
|
#### Defined in
|
|
400
400
|
|
|
401
|
-
[filterName.ts:4](https://github.com/daysnap/utils/blob/
|
|
401
|
+
[filterName.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/filterName.ts#L4)
|
|
402
402
|
|
|
403
403
|
___
|
|
404
404
|
|
|
@@ -423,7 +423,7 @@ filterPhone('13177778888', ' ') => 131 **** 8888
|
|
|
423
423
|
|
|
424
424
|
#### Defined in
|
|
425
425
|
|
|
426
|
-
[filterPhone.ts:6](https://github.com/daysnap/utils/blob/
|
|
426
|
+
[filterPhone.ts:6](https://github.com/daysnap/utils/blob/cd56451/src/filterPhone.ts#L6)
|
|
427
427
|
|
|
428
428
|
___
|
|
429
429
|
|
|
@@ -437,7 +437,7 @@ ___
|
|
|
437
437
|
|
|
438
438
|
| Name | Type | Default value |
|
|
439
439
|
| :------ | :------ | :------ |
|
|
440
|
-
| `s` | `string` | `undefined` |
|
|
440
|
+
| `s` | `string` \| `number` | `undefined` |
|
|
441
441
|
| `radix` | `number` | `1` |
|
|
442
442
|
|
|
443
443
|
#### Returns
|
|
@@ -446,7 +446,7 @@ ___
|
|
|
446
446
|
|
|
447
447
|
#### Defined in
|
|
448
448
|
|
|
449
|
-
[formatAmount.ts:4](https://github.com/daysnap/utils/blob/
|
|
449
|
+
[formatAmount.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/formatAmount.ts#L4)
|
|
450
450
|
|
|
451
451
|
___
|
|
452
452
|
|
|
@@ -469,7 +469,7 @@ ___
|
|
|
469
469
|
|
|
470
470
|
#### Defined in
|
|
471
471
|
|
|
472
|
-
[formatDate.ts:6](https://github.com/daysnap/utils/blob/
|
|
472
|
+
[formatDate.ts:6](https://github.com/daysnap/utils/blob/cd56451/src/formatDate.ts#L6)
|
|
473
473
|
|
|
474
474
|
___
|
|
475
475
|
|
|
@@ -491,7 +491,7 @@ ___
|
|
|
491
491
|
|
|
492
492
|
#### Defined in
|
|
493
493
|
|
|
494
|
-
[getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/
|
|
494
|
+
[getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/getBlobByUrl.ts#L4)
|
|
495
495
|
|
|
496
496
|
___
|
|
497
497
|
|
|
@@ -506,15 +506,15 @@ ___
|
|
|
506
506
|
| Name | Type |
|
|
507
507
|
| :------ | :------ |
|
|
508
508
|
| `clear` | () => `void` |
|
|
509
|
-
| `generate` | <T\>(`key`: `string`) => { `getItem`: (`defaultVal?`: `Partial`<`T`\>) => `
|
|
510
|
-
| `getItem` | <T\>(`key`: `string`, `defaultVal`: `Partial`<`T`\>) => `
|
|
509
|
+
| `generate` | <T\>(`key`: `string`) => { `getItem`: (`defaultVal?`: `Partial`<`T`\>) => `T` ; `removeItem`: () => `void` ; `setItem`: (`val`: `T`) => `T` ; `updateItem`: (`val`: `Partial`<`T`\>) => `T` } |
|
|
510
|
+
| `getItem` | <T\>(`key`: `string`, `defaultVal`: `Partial`<`T`\>) => `T` |
|
|
511
511
|
| `removeItem` | (`key`: `string`) => `void` |
|
|
512
512
|
| `setItem` | <T\>(`key`: `string`, `val`: `T`) => `T` |
|
|
513
513
|
| `updateItem` | <T\>(`key`: `string`, `val`: `Partial`<`T`\>) => `T` |
|
|
514
514
|
|
|
515
515
|
#### Defined in
|
|
516
516
|
|
|
517
|
-
[storage/index.ts:7](https://github.com/daysnap/utils/blob/
|
|
517
|
+
[storage/index.ts:7](https://github.com/daysnap/utils/blob/cd56451/src/storage/index.ts#L7)
|
|
518
518
|
|
|
519
519
|
___
|
|
520
520
|
|
|
@@ -536,7 +536,7 @@ ___
|
|
|
536
536
|
|
|
537
537
|
#### Defined in
|
|
538
538
|
|
|
539
|
-
[getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/
|
|
539
|
+
[getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/getDayMillisecond.ts#L4)
|
|
540
540
|
|
|
541
541
|
___
|
|
542
542
|
|
|
@@ -558,7 +558,7 @@ ___
|
|
|
558
558
|
|
|
559
559
|
#### Defined in
|
|
560
560
|
|
|
561
|
-
[getImageInfo.ts:4](https://github.com/daysnap/utils/blob/
|
|
561
|
+
[getImageInfo.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/getImageInfo.ts#L4)
|
|
562
562
|
|
|
563
563
|
___
|
|
564
564
|
|
|
@@ -573,15 +573,15 @@ ___
|
|
|
573
573
|
| Name | Type |
|
|
574
574
|
| :------ | :------ |
|
|
575
575
|
| `clear` | () => `void` |
|
|
576
|
-
| `generate` | <T\>(`key`: `string`) => { `getItem`: (`defaultVal?`: `Partial`<`T`\>) => `
|
|
577
|
-
| `getItem` | <T\>(`key`: `string`, `defaultVal`: `Partial`<`T`\>) => `
|
|
576
|
+
| `generate` | <T\>(`key`: `string`) => { `getItem`: (`defaultVal?`: `Partial`<`T`\>) => `T` ; `removeItem`: () => `void` ; `setItem`: (`val`: `T`) => `T` ; `updateItem`: (`val`: `Partial`<`T`\>) => `T` } |
|
|
577
|
+
| `getItem` | <T\>(`key`: `string`, `defaultVal`: `Partial`<`T`\>) => `T` |
|
|
578
578
|
| `removeItem` | (`key`: `string`) => `void` |
|
|
579
579
|
| `setItem` | <T\>(`key`: `string`, `val`: `T`) => `T` |
|
|
580
580
|
| `updateItem` | <T\>(`key`: `string`, `val`: `Partial`<`T`\>) => `T` |
|
|
581
581
|
|
|
582
582
|
#### Defined in
|
|
583
583
|
|
|
584
|
-
[storage/index.ts:7](https://github.com/daysnap/utils/blob/
|
|
584
|
+
[storage/index.ts:7](https://github.com/daysnap/utils/blob/cd56451/src/storage/index.ts#L7)
|
|
585
585
|
|
|
586
586
|
___
|
|
587
587
|
|
|
@@ -597,7 +597,7 @@ ___
|
|
|
597
597
|
|
|
598
598
|
#### Defined in
|
|
599
599
|
|
|
600
|
-
[getRandomColor.ts:4](https://github.com/daysnap/utils/blob/
|
|
600
|
+
[getRandomColor.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/getRandomColor.ts#L4)
|
|
601
601
|
|
|
602
602
|
___
|
|
603
603
|
|
|
@@ -619,7 +619,7 @@ ___
|
|
|
619
619
|
|
|
620
620
|
#### Defined in
|
|
621
621
|
|
|
622
|
-
[getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/
|
|
622
|
+
[getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/getVideoInfo.ts#L4)
|
|
623
623
|
|
|
624
624
|
___
|
|
625
625
|
|
|
@@ -635,7 +635,7 @@ ___
|
|
|
635
635
|
|
|
636
636
|
#### Defined in
|
|
637
637
|
|
|
638
|
-
[inBrowser.ts:4](https://github.com/daysnap/utils/blob/
|
|
638
|
+
[inBrowser.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/inBrowser.ts#L4)
|
|
639
639
|
|
|
640
640
|
___
|
|
641
641
|
|
|
@@ -651,7 +651,7 @@ ___
|
|
|
651
651
|
|
|
652
652
|
#### Defined in
|
|
653
653
|
|
|
654
|
-
[isAndroid.ts:4](https://github.com/daysnap/utils/blob/
|
|
654
|
+
[isAndroid.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isAndroid.ts#L4)
|
|
655
655
|
|
|
656
656
|
___
|
|
657
657
|
|
|
@@ -675,7 +675,7 @@ val is any[]
|
|
|
675
675
|
|
|
676
676
|
#### Defined in
|
|
677
677
|
|
|
678
|
-
[isArray.ts:6](https://github.com/daysnap/utils/blob/
|
|
678
|
+
[isArray.ts:6](https://github.com/daysnap/utils/blob/cd56451/src/isArray.ts#L6)
|
|
679
679
|
|
|
680
680
|
___
|
|
681
681
|
|
|
@@ -697,7 +697,7 @@ val is boolean
|
|
|
697
697
|
|
|
698
698
|
#### Defined in
|
|
699
699
|
|
|
700
|
-
[isBoolean.ts:5](https://github.com/daysnap/utils/blob/
|
|
700
|
+
[isBoolean.ts:5](https://github.com/daysnap/utils/blob/cd56451/src/isBoolean.ts#L5)
|
|
701
701
|
|
|
702
702
|
___
|
|
703
703
|
|
|
@@ -719,7 +719,7 @@ ___
|
|
|
719
719
|
|
|
720
720
|
#### Defined in
|
|
721
721
|
|
|
722
|
-
[isEmail.ts:4](https://github.com/daysnap/utils/blob/
|
|
722
|
+
[isEmail.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isEmail.ts#L4)
|
|
723
723
|
|
|
724
724
|
___
|
|
725
725
|
|
|
@@ -741,7 +741,7 @@ ___
|
|
|
741
741
|
|
|
742
742
|
#### Defined in
|
|
743
743
|
|
|
744
|
-
[isEmpty.ts:6](https://github.com/daysnap/utils/blob/
|
|
744
|
+
[isEmpty.ts:6](https://github.com/daysnap/utils/blob/cd56451/src/isEmpty.ts#L6)
|
|
745
745
|
|
|
746
746
|
___
|
|
747
747
|
|
|
@@ -763,7 +763,7 @@ ___
|
|
|
763
763
|
|
|
764
764
|
#### Defined in
|
|
765
765
|
|
|
766
|
-
[isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/
|
|
766
|
+
[isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/cd56451/src/isEmptyObject.ts#L5)
|
|
767
767
|
|
|
768
768
|
___
|
|
769
769
|
|
|
@@ -785,7 +785,7 @@ val is Error
|
|
|
785
785
|
|
|
786
786
|
#### Defined in
|
|
787
787
|
|
|
788
|
-
[isError.ts:4](https://github.com/daysnap/utils/blob/
|
|
788
|
+
[isError.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isError.ts#L4)
|
|
789
789
|
|
|
790
790
|
___
|
|
791
791
|
|
|
@@ -807,7 +807,7 @@ val is Function
|
|
|
807
807
|
|
|
808
808
|
#### Defined in
|
|
809
809
|
|
|
810
|
-
[isFunction.ts:4](https://github.com/daysnap/utils/blob/
|
|
810
|
+
[isFunction.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isFunction.ts#L4)
|
|
811
811
|
|
|
812
812
|
___
|
|
813
813
|
|
|
@@ -823,7 +823,7 @@ ___
|
|
|
823
823
|
|
|
824
824
|
#### Defined in
|
|
825
825
|
|
|
826
|
-
[isIOS.ts:4](https://github.com/daysnap/utils/blob/
|
|
826
|
+
[isIOS.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isIOS.ts#L4)
|
|
827
827
|
|
|
828
828
|
___
|
|
829
829
|
|
|
@@ -845,7 +845,7 @@ ___
|
|
|
845
845
|
|
|
846
846
|
#### Defined in
|
|
847
847
|
|
|
848
|
-
[isIdCard.ts:4](https://github.com/daysnap/utils/blob/
|
|
848
|
+
[isIdCard.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isIdCard.ts#L4)
|
|
849
849
|
|
|
850
850
|
___
|
|
851
851
|
|
|
@@ -867,7 +867,7 @@ ___
|
|
|
867
867
|
|
|
868
868
|
#### Defined in
|
|
869
869
|
|
|
870
|
-
[isJSONString.ts:7](https://github.com/daysnap/utils/blob/
|
|
870
|
+
[isJSONString.ts:7](https://github.com/daysnap/utils/blob/cd56451/src/isJSONString.ts#L7)
|
|
871
871
|
|
|
872
872
|
___
|
|
873
873
|
|
|
@@ -889,7 +889,7 @@ ___
|
|
|
889
889
|
|
|
890
890
|
#### Defined in
|
|
891
891
|
|
|
892
|
-
[isLan.ts:5](https://github.com/daysnap/utils/blob/
|
|
892
|
+
[isLan.ts:5](https://github.com/daysnap/utils/blob/cd56451/src/isLan.ts#L5)
|
|
893
893
|
|
|
894
894
|
___
|
|
895
895
|
|
|
@@ -911,7 +911,7 @@ ___
|
|
|
911
911
|
|
|
912
912
|
#### Defined in
|
|
913
913
|
|
|
914
|
-
[isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/
|
|
914
|
+
[isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/cd56451/src/isLicenseCode.ts#L5)
|
|
915
915
|
|
|
916
916
|
___
|
|
917
917
|
|
|
@@ -927,7 +927,7 @@ ___
|
|
|
927
927
|
|
|
928
928
|
#### Defined in
|
|
929
929
|
|
|
930
|
-
[isMobile.ts:4](https://github.com/daysnap/utils/blob/
|
|
930
|
+
[isMobile.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isMobile.ts#L4)
|
|
931
931
|
|
|
932
932
|
___
|
|
933
933
|
|
|
@@ -949,7 +949,7 @@ val is null
|
|
|
949
949
|
|
|
950
950
|
#### Defined in
|
|
951
951
|
|
|
952
|
-
[isNull.ts:4](https://github.com/daysnap/utils/blob/
|
|
952
|
+
[isNull.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isNull.ts#L4)
|
|
953
953
|
|
|
954
954
|
___
|
|
955
955
|
|
|
@@ -971,7 +971,7 @@ val is number
|
|
|
971
971
|
|
|
972
972
|
#### Defined in
|
|
973
973
|
|
|
974
|
-
[isNumber.ts:5](https://github.com/daysnap/utils/blob/
|
|
974
|
+
[isNumber.ts:5](https://github.com/daysnap/utils/blob/cd56451/src/isNumber.ts#L5)
|
|
975
975
|
|
|
976
976
|
___
|
|
977
977
|
|
|
@@ -993,7 +993,7 @@ val is Record<string, any\>
|
|
|
993
993
|
|
|
994
994
|
#### Defined in
|
|
995
995
|
|
|
996
|
-
[isObject.ts:4](https://github.com/daysnap/utils/blob/
|
|
996
|
+
[isObject.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isObject.ts#L4)
|
|
997
997
|
|
|
998
998
|
___
|
|
999
999
|
|
|
@@ -1015,7 +1015,7 @@ ___
|
|
|
1015
1015
|
|
|
1016
1016
|
#### Defined in
|
|
1017
1017
|
|
|
1018
|
-
[isPhone.ts:4](https://github.com/daysnap/utils/blob/
|
|
1018
|
+
[isPhone.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isPhone.ts#L4)
|
|
1019
1019
|
|
|
1020
1020
|
___
|
|
1021
1021
|
|
|
@@ -1043,7 +1043,7 @@ val is Promise<T\>
|
|
|
1043
1043
|
|
|
1044
1044
|
#### Defined in
|
|
1045
1045
|
|
|
1046
|
-
[isPromise.ts:4](https://github.com/daysnap/utils/blob/
|
|
1046
|
+
[isPromise.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isPromise.ts#L4)
|
|
1047
1047
|
|
|
1048
1048
|
___
|
|
1049
1049
|
|
|
@@ -1065,7 +1065,7 @@ val is RegExp
|
|
|
1065
1065
|
|
|
1066
1066
|
#### Defined in
|
|
1067
1067
|
|
|
1068
|
-
[isRegExp.ts:4](https://github.com/daysnap/utils/blob/
|
|
1068
|
+
[isRegExp.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isRegExp.ts#L4)
|
|
1069
1069
|
|
|
1070
1070
|
___
|
|
1071
1071
|
|
|
@@ -1087,7 +1087,7 @@ val is string
|
|
|
1087
1087
|
|
|
1088
1088
|
#### Defined in
|
|
1089
1089
|
|
|
1090
|
-
[isString.ts:4](https://github.com/daysnap/utils/blob/
|
|
1090
|
+
[isString.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isString.ts#L4)
|
|
1091
1091
|
|
|
1092
1092
|
___
|
|
1093
1093
|
|
|
@@ -1109,7 +1109,7 @@ val is undefined
|
|
|
1109
1109
|
|
|
1110
1110
|
#### Defined in
|
|
1111
1111
|
|
|
1112
|
-
[isUndefined.ts:4](https://github.com/daysnap/utils/blob/
|
|
1112
|
+
[isUndefined.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isUndefined.ts#L4)
|
|
1113
1113
|
|
|
1114
1114
|
___
|
|
1115
1115
|
|
|
@@ -1125,7 +1125,7 @@ ___
|
|
|
1125
1125
|
|
|
1126
1126
|
#### Defined in
|
|
1127
1127
|
|
|
1128
|
-
[isWeixin.ts:4](https://github.com/daysnap/utils/blob/
|
|
1128
|
+
[isWeixin.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/isWeixin.ts#L4)
|
|
1129
1129
|
|
|
1130
1130
|
___
|
|
1131
1131
|
|
|
@@ -1147,7 +1147,7 @@ val is Window
|
|
|
1147
1147
|
|
|
1148
1148
|
#### Defined in
|
|
1149
1149
|
|
|
1150
|
-
[isWindow.ts:5](https://github.com/daysnap/utils/blob/
|
|
1150
|
+
[isWindow.ts:5](https://github.com/daysnap/utils/blob/cd56451/src/isWindow.ts#L5)
|
|
1151
1151
|
|
|
1152
1152
|
___
|
|
1153
1153
|
|
|
@@ -1171,7 +1171,7 @@ ___
|
|
|
1171
1171
|
|
|
1172
1172
|
#### Defined in
|
|
1173
1173
|
|
|
1174
|
-
[loadResource.ts:9](https://github.com/daysnap/utils/blob/
|
|
1174
|
+
[loadResource.ts:9](https://github.com/daysnap/utils/blob/cd56451/src/loadResource.ts#L9)
|
|
1175
1175
|
|
|
1176
1176
|
___
|
|
1177
1177
|
|
|
@@ -1201,7 +1201,7 @@ ___
|
|
|
1201
1201
|
|
|
1202
1202
|
#### Defined in
|
|
1203
1203
|
|
|
1204
|
-
[omit.ts:4](https://github.com/daysnap/utils/blob/
|
|
1204
|
+
[omit.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/omit.ts#L4)
|
|
1205
1205
|
|
|
1206
1206
|
___
|
|
1207
1207
|
|
|
@@ -1225,7 +1225,7 @@ ___
|
|
|
1225
1225
|
|
|
1226
1226
|
#### Defined in
|
|
1227
1227
|
|
|
1228
|
-
[padding.ts:7](https://github.com/daysnap/utils/blob/
|
|
1228
|
+
[padding.ts:7](https://github.com/daysnap/utils/blob/cd56451/src/padding.ts#L7)
|
|
1229
1229
|
|
|
1230
1230
|
___
|
|
1231
1231
|
|
|
@@ -1247,7 +1247,7 @@ ___
|
|
|
1247
1247
|
|
|
1248
1248
|
#### Defined in
|
|
1249
1249
|
|
|
1250
|
-
[parseDate.ts:4](https://github.com/daysnap/utils/blob/
|
|
1250
|
+
[parseDate.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/parseDate.ts#L4)
|
|
1251
1251
|
|
|
1252
1252
|
___
|
|
1253
1253
|
|
|
@@ -1270,7 +1270,7 @@ ___
|
|
|
1270
1270
|
|
|
1271
1271
|
#### Defined in
|
|
1272
1272
|
|
|
1273
|
-
[parseError.ts:8](https://github.com/daysnap/utils/blob/
|
|
1273
|
+
[parseError.ts:8](https://github.com/daysnap/utils/blob/cd56451/src/parseError.ts#L8)
|
|
1274
1274
|
|
|
1275
1275
|
___
|
|
1276
1276
|
|
|
@@ -1299,7 +1299,7 @@ ___
|
|
|
1299
1299
|
|
|
1300
1300
|
#### Defined in
|
|
1301
1301
|
|
|
1302
|
-
[parseObject.ts:4](https://github.com/daysnap/utils/blob/
|
|
1302
|
+
[parseObject.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/parseObject.ts#L4)
|
|
1303
1303
|
|
|
1304
1304
|
___
|
|
1305
1305
|
|
|
@@ -1328,7 +1328,7 @@ ___
|
|
|
1328
1328
|
|
|
1329
1329
|
#### Defined in
|
|
1330
1330
|
|
|
1331
|
-
[parsePath.ts:4](https://github.com/daysnap/utils/blob/
|
|
1331
|
+
[parsePath.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/parsePath.ts#L4)
|
|
1332
1332
|
|
|
1333
1333
|
___
|
|
1334
1334
|
|
|
@@ -1351,7 +1351,7 @@ ___
|
|
|
1351
1351
|
|
|
1352
1352
|
#### Defined in
|
|
1353
1353
|
|
|
1354
|
-
[parseQuery.ts:8](https://github.com/daysnap/utils/blob/
|
|
1354
|
+
[parseQuery.ts:8](https://github.com/daysnap/utils/blob/cd56451/src/parseQuery.ts#L8)
|
|
1355
1355
|
|
|
1356
1356
|
___
|
|
1357
1357
|
|
|
@@ -1381,7 +1381,7 @@ ___
|
|
|
1381
1381
|
|
|
1382
1382
|
#### Defined in
|
|
1383
1383
|
|
|
1384
|
-
[pick.ts:4](https://github.com/daysnap/utils/blob/
|
|
1384
|
+
[pick.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/pick.ts#L4)
|
|
1385
1385
|
|
|
1386
1386
|
___
|
|
1387
1387
|
|
|
@@ -1404,7 +1404,7 @@ ___
|
|
|
1404
1404
|
|
|
1405
1405
|
#### Defined in
|
|
1406
1406
|
|
|
1407
|
-
[replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/
|
|
1407
|
+
[replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/replaceCrlf.ts#L4)
|
|
1408
1408
|
|
|
1409
1409
|
___
|
|
1410
1410
|
|
|
@@ -1430,7 +1430,7 @@ reserve(0, '--') => 0
|
|
|
1430
1430
|
|
|
1431
1431
|
#### Defined in
|
|
1432
1432
|
|
|
1433
|
-
[reserve.ts:8](https://github.com/daysnap/utils/blob/
|
|
1433
|
+
[reserve.ts:8](https://github.com/daysnap/utils/blob/cd56451/src/reserve.ts#L8)
|
|
1434
1434
|
|
|
1435
1435
|
___
|
|
1436
1436
|
|
|
@@ -1453,7 +1453,7 @@ ___
|
|
|
1453
1453
|
|
|
1454
1454
|
#### Defined in
|
|
1455
1455
|
|
|
1456
|
-
[round.ts:6](https://github.com/daysnap/utils/blob/
|
|
1456
|
+
[round.ts:6](https://github.com/daysnap/utils/blob/cd56451/src/round.ts#L6)
|
|
1457
1457
|
|
|
1458
1458
|
___
|
|
1459
1459
|
|
|
@@ -1476,7 +1476,7 @@ ___
|
|
|
1476
1476
|
|
|
1477
1477
|
#### Defined in
|
|
1478
1478
|
|
|
1479
|
-
[sleep.ts:4](https://github.com/daysnap/utils/blob/
|
|
1479
|
+
[sleep.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/sleep.ts#L4)
|
|
1480
1480
|
|
|
1481
1481
|
___
|
|
1482
1482
|
|
|
@@ -1499,7 +1499,7 @@ ___
|
|
|
1499
1499
|
|
|
1500
1500
|
#### Defined in
|
|
1501
1501
|
|
|
1502
|
-
[stringTrim.ts:4](https://github.com/daysnap/utils/blob/
|
|
1502
|
+
[stringTrim.ts:4](https://github.com/daysnap/utils/blob/cd56451/src/stringTrim.ts#L4)
|
|
1503
1503
|
|
|
1504
1504
|
___
|
|
1505
1505
|
|
|
@@ -1521,7 +1521,7 @@ ___
|
|
|
1521
1521
|
|
|
1522
1522
|
#### Defined in
|
|
1523
1523
|
|
|
1524
|
-
[stringifyQuery.ts:6](https://github.com/daysnap/utils/blob/
|
|
1524
|
+
[stringifyQuery.ts:6](https://github.com/daysnap/utils/blob/cd56451/src/stringifyQuery.ts#L6)
|
|
1525
1525
|
|
|
1526
1526
|
___
|
|
1527
1527
|
|
|
@@ -1551,4 +1551,4 @@ val is T
|
|
|
1551
1551
|
|
|
1552
1552
|
#### Defined in
|
|
1553
1553
|
|
|
1554
|
-
[typeOf.ts:6](https://github.com/daysnap/utils/blob/
|
|
1554
|
+
[typeOf.ts:6](https://github.com/daysnap/utils/blob/cd56451/src/typeOf.ts#L6)
|
package/es/formatAmount.d.ts
CHANGED
package/es/formatAmount.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export function formatAmount(s) {
|
|
5
5
|
var radix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
6
|
-
var money = parseFloat(s);
|
|
6
|
+
var money = parseFloat(s.toString());
|
|
7
7
|
if (money) {
|
|
8
8
|
// eslint-disable-next-line no-param-reassign
|
|
9
9
|
s = "".concat((money / radix).toFixed(2));
|
package/es/parsePath.js
CHANGED
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
export function parsePath(obj, path) {
|
|
5
5
|
var segments = path ? path.split('.') : [];
|
|
6
6
|
segments.forEach(function (key) {
|
|
7
|
-
var _obj$key;
|
|
8
7
|
// eslint-disable-next-line no-param-reassign
|
|
9
|
-
obj =
|
|
8
|
+
obj = obj[key];
|
|
10
9
|
});
|
|
11
10
|
return obj;
|
|
12
11
|
}
|
package/es/storage/factory.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare function factory(type: 'sessionStorage' | 'localStorage'): {
|
|
2
|
-
setItem: <T>(key: string, val: T) => T;
|
|
3
|
-
getItem: <T_1>(key: string, defaultVal?: Partial<T_1>) =>
|
|
2
|
+
setItem: <T = any>(key: string, val: T) => T;
|
|
3
|
+
getItem: <T_1 = any>(key: string, defaultVal?: Partial<T_1>) => T_1;
|
|
4
4
|
removeItem: (key: string) => void;
|
|
5
|
-
updateItem: <T_2>(key: string, val: Partial<T_2>) => T_2;
|
|
5
|
+
updateItem: <T_2 = any>(key: string, val: Partial<T_2>) => T_2;
|
|
6
6
|
clear: () => void;
|
|
7
|
-
generate: <T_3>(key: string) => {
|
|
7
|
+
generate: <T_3 = any>(key: string) => {
|
|
8
8
|
setItem: (val: T_3) => T_3;
|
|
9
|
-
getItem: (defaultVal?: Partial<T_3>) =>
|
|
9
|
+
getItem: (defaultVal?: Partial<T_3>) => T_3;
|
|
10
10
|
removeItem: () => void;
|
|
11
11
|
updateItem: (val: Partial<T_3>) => T_3;
|
|
12
12
|
};
|
package/es/storage/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export declare const getCache: () => {
|
|
2
|
-
setItem: <T>(key: string, val: T) => T;
|
|
3
|
-
getItem: <T_1>(key: string, defaultVal?: Partial<T_1>) =>
|
|
2
|
+
setItem: <T = any>(key: string, val: T) => T;
|
|
3
|
+
getItem: <T_1 = any>(key: string, defaultVal?: Partial<T_1>) => T_1;
|
|
4
4
|
removeItem: (key: string) => void;
|
|
5
|
-
updateItem: <T_2>(key: string, val: Partial<T_2>) => T_2;
|
|
5
|
+
updateItem: <T_2 = any>(key: string, val: Partial<T_2>) => T_2;
|
|
6
6
|
clear: () => void;
|
|
7
|
-
generate: <T_3>(key: string) => {
|
|
7
|
+
generate: <T_3 = any>(key: string) => {
|
|
8
8
|
setItem: (val: T_3) => T_3;
|
|
9
|
-
getItem: (defaultVal?: Partial<T_3>) =>
|
|
9
|
+
getItem: (defaultVal?: Partial<T_3>) => T_3;
|
|
10
10
|
removeItem: () => void;
|
|
11
11
|
updateItem: (val: Partial<T_3>) => T_3;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
export declare const getLocal: () => {
|
|
15
|
-
setItem: <T>(key: string, val: T) => T;
|
|
16
|
-
getItem: <T_1>(key: string, defaultVal?: Partial<T_1>) =>
|
|
15
|
+
setItem: <T = any>(key: string, val: T) => T;
|
|
16
|
+
getItem: <T_1 = any>(key: string, defaultVal?: Partial<T_1>) => T_1;
|
|
17
17
|
removeItem: (key: string) => void;
|
|
18
|
-
updateItem: <T_2>(key: string, val: Partial<T_2>) => T_2;
|
|
18
|
+
updateItem: <T_2 = any>(key: string, val: Partial<T_2>) => T_2;
|
|
19
19
|
clear: () => void;
|
|
20
|
-
generate: <T_3>(key: string) => {
|
|
20
|
+
generate: <T_3 = any>(key: string) => {
|
|
21
21
|
setItem: (val: T_3) => T_3;
|
|
22
|
-
getItem: (defaultVal?: Partial<T_3>) =>
|
|
22
|
+
getItem: (defaultVal?: Partial<T_3>) => T_3;
|
|
23
23
|
removeItem: () => void;
|
|
24
24
|
updateItem: (val: Partial<T_3>) => T_3;
|
|
25
25
|
};
|
package/lib/formatAmount.d.ts
CHANGED
package/lib/formatAmount.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.formatAmount = formatAmount;
|
|
|
9
9
|
*/
|
|
10
10
|
function formatAmount(s) {
|
|
11
11
|
var radix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
12
|
-
var money = parseFloat(s);
|
|
12
|
+
var money = parseFloat(s.toString());
|
|
13
13
|
if (money) {
|
|
14
14
|
// eslint-disable-next-line no-param-reassign
|
|
15
15
|
s = "".concat((money / radix).toFixed(2));
|
package/lib/parsePath.js
CHANGED
|
@@ -10,9 +10,8 @@ exports.parsePath = parsePath;
|
|
|
10
10
|
function parsePath(obj, path) {
|
|
11
11
|
var segments = path ? path.split('.') : [];
|
|
12
12
|
segments.forEach(function (key) {
|
|
13
|
-
var _obj$key;
|
|
14
13
|
// eslint-disable-next-line no-param-reassign
|
|
15
|
-
obj =
|
|
14
|
+
obj = obj[key];
|
|
16
15
|
});
|
|
17
16
|
return obj;
|
|
18
17
|
}
|
package/lib/storage/factory.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare function factory(type: 'sessionStorage' | 'localStorage'): {
|
|
2
|
-
setItem: <T>(key: string, val: T) => T;
|
|
3
|
-
getItem: <T_1>(key: string, defaultVal?: Partial<T_1>) =>
|
|
2
|
+
setItem: <T = any>(key: string, val: T) => T;
|
|
3
|
+
getItem: <T_1 = any>(key: string, defaultVal?: Partial<T_1>) => T_1;
|
|
4
4
|
removeItem: (key: string) => void;
|
|
5
|
-
updateItem: <T_2>(key: string, val: Partial<T_2>) => T_2;
|
|
5
|
+
updateItem: <T_2 = any>(key: string, val: Partial<T_2>) => T_2;
|
|
6
6
|
clear: () => void;
|
|
7
|
-
generate: <T_3>(key: string) => {
|
|
7
|
+
generate: <T_3 = any>(key: string) => {
|
|
8
8
|
setItem: (val: T_3) => T_3;
|
|
9
|
-
getItem: (defaultVal?: Partial<T_3>) =>
|
|
9
|
+
getItem: (defaultVal?: Partial<T_3>) => T_3;
|
|
10
10
|
removeItem: () => void;
|
|
11
11
|
updateItem: (val: Partial<T_3>) => T_3;
|
|
12
12
|
};
|
package/lib/storage/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export declare const getCache: () => {
|
|
2
|
-
setItem: <T>(key: string, val: T) => T;
|
|
3
|
-
getItem: <T_1>(key: string, defaultVal?: Partial<T_1>) =>
|
|
2
|
+
setItem: <T = any>(key: string, val: T) => T;
|
|
3
|
+
getItem: <T_1 = any>(key: string, defaultVal?: Partial<T_1>) => T_1;
|
|
4
4
|
removeItem: (key: string) => void;
|
|
5
|
-
updateItem: <T_2>(key: string, val: Partial<T_2>) => T_2;
|
|
5
|
+
updateItem: <T_2 = any>(key: string, val: Partial<T_2>) => T_2;
|
|
6
6
|
clear: () => void;
|
|
7
|
-
generate: <T_3>(key: string) => {
|
|
7
|
+
generate: <T_3 = any>(key: string) => {
|
|
8
8
|
setItem: (val: T_3) => T_3;
|
|
9
|
-
getItem: (defaultVal?: Partial<T_3>) =>
|
|
9
|
+
getItem: (defaultVal?: Partial<T_3>) => T_3;
|
|
10
10
|
removeItem: () => void;
|
|
11
11
|
updateItem: (val: Partial<T_3>) => T_3;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
export declare const getLocal: () => {
|
|
15
|
-
setItem: <T>(key: string, val: T) => T;
|
|
16
|
-
getItem: <T_1>(key: string, defaultVal?: Partial<T_1>) =>
|
|
15
|
+
setItem: <T = any>(key: string, val: T) => T;
|
|
16
|
+
getItem: <T_1 = any>(key: string, defaultVal?: Partial<T_1>) => T_1;
|
|
17
17
|
removeItem: (key: string) => void;
|
|
18
|
-
updateItem: <T_2>(key: string, val: Partial<T_2>) => T_2;
|
|
18
|
+
updateItem: <T_2 = any>(key: string, val: Partial<T_2>) => T_2;
|
|
19
19
|
clear: () => void;
|
|
20
|
-
generate: <T_3>(key: string) => {
|
|
20
|
+
generate: <T_3 = any>(key: string) => {
|
|
21
21
|
setItem: (val: T_3) => T_3;
|
|
22
|
-
getItem: (defaultVal?: Partial<T_3>) =>
|
|
22
|
+
getItem: (defaultVal?: Partial<T_3>) => T_3;
|
|
23
23
|
removeItem: () => void;
|
|
24
24
|
updateItem: (val: Partial<T_3>) => T_3;
|
|
25
25
|
};
|