@daysnap/utils 0.0.47 → 0.0.48

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/README.md ADDED
@@ -0,0 +1,37 @@
1
+ @daysnap/utils / [Exports](modules.md)
2
+
3
+ <p align="center">
4
+ <img alt="logo" src="https://avatars.githubusercontent.com/u/96568061?s=200&v=4" width="120" height="120" style="margin-bottom: 10px;">
5
+ </p>
6
+
7
+ <h1 align="center">@daysnap/utils</h1>
8
+
9
+ <p align="center">日常工作中常用的工具函数</p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.org/package/@daysnap/utils">
13
+ <img src="https://img.shields.io/npm/v/@daysnap/utils.svg" alt="npm version" />
14
+ </a>
15
+ <a href="https://npmcharts.com/compare/@daysnap/utils">
16
+ <img src="https://img.shields.io/npm/dm/@daysnap/utils.svg">
17
+ </a>
18
+ </p>
19
+
20
+ ## 使用
21
+
22
+ - 安装
23
+ ```shell
24
+ npm install @daysnap/utils
25
+
26
+ # or
27
+ yarn add @daysnap/utils
28
+ ```
29
+
30
+ - 引入
31
+ ```js
32
+ import { debounce } from '@daysnap/utils'
33
+ ```
34
+
35
+ ## 详情 API 文档
36
+
37
+ [点我查看](./docs/modules.md)
package/docs/modules.md CHANGED
@@ -8,7 +8,9 @@
8
8
 
9
9
  - [base64ToBlob](modules.md#base64toblob)
10
10
  - [blobToBase64](modules.md#blobtobase64)
11
+ - [camelCase](modules.md#camelcase)
11
12
  - [canvasToBlob](modules.md#canvastoblob)
13
+ - [capitalize](modules.md#capitalize)
12
14
  - [clone](modules.md#clone)
13
15
  - [cloneSimple](modules.md#clonesimple)
14
16
  - [colorGenByHash](modules.md#colorgenbyhash)
@@ -25,6 +27,7 @@
25
27
  - [filterPhone](modules.md#filterphone)
26
28
  - [formatAmount](modules.md#formatamount)
27
29
  - [formatDate](modules.md#formatdate)
30
+ - [formatMessage](modules.md#formatmessage)
28
31
  - [getBlobByUrl](modules.md#getblobbyurl)
29
32
  - [getCache](modules.md#getcache)
30
33
  - [getDayMillisecond](modules.md#getdaymillisecond)
@@ -33,6 +36,9 @@
33
36
  - [getRandomColor](modules.md#getrandomcolor)
34
37
  - [getVideoInfo](modules.md#getvideoinfo)
35
38
  - [inBrowser](modules.md#inbrowser)
39
+ - [insertLink](modules.md#insertlink)
40
+ - [insertScript](modules.md#insertscript)
41
+ - [insertStyle](modules.md#insertstyle)
36
42
  - [isAndroid](modules.md#isandroid)
37
43
  - [isArray](modules.md#isarray)
38
44
  - [isBoolean](modules.md#isboolean)
@@ -58,7 +64,7 @@
58
64
  - [isUndefined](modules.md#isundefined)
59
65
  - [isWeixin](modules.md#isweixin)
60
66
  - [isWindow](modules.md#iswindow)
61
- - [loadResource](modules.md#loadresource)
67
+ - [kebabCase](modules.md#kebabcase)
62
68
  - [omit](modules.md#omit)
63
69
  - [padding](modules.md#padding)
64
70
  - [parseDate](modules.md#parsedate)
@@ -66,6 +72,7 @@
66
72
  - [parseObject](modules.md#parseobject)
67
73
  - [parsePath](modules.md#parsepath)
68
74
  - [parseQuery](modules.md#parsequery)
75
+ - [pascalCase](modules.md#pascalcase)
69
76
  - [pick](modules.md#pick)
70
77
  - [replaceCrlf](modules.md#replacecrlf)
71
78
  - [reserve](modules.md#reserve)
@@ -97,7 +104,7 @@ base64 转 blob
97
104
 
98
105
  #### Defined in
99
106
 
100
- [base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/base64ToBlob.ts#L6)
107
+ [base64ToBlob.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/base64ToBlob.ts#L6)
101
108
 
102
109
  ___
103
110
 
@@ -119,7 +126,30 @@ blob 转 base64
119
126
 
120
127
  #### Defined in
121
128
 
122
- [blobToBase64.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/blobToBase64.ts#L4)
129
+ [blobToBase64.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/blobToBase64.ts#L4)
130
+
131
+ ___
132
+
133
+ ### camelCase
134
+
135
+ ▸ **camelCase**(`str`): `string`
136
+
137
+ 驼峰
138
+ camelCase('hello-world') => helloWorld
139
+
140
+ #### Parameters
141
+
142
+ | Name | Type |
143
+ | :------ | :------ |
144
+ | `str` | `string` |
145
+
146
+ #### Returns
147
+
148
+ `string`
149
+
150
+ #### Defined in
151
+
152
+ camelCase.ts:5
123
153
 
124
154
  ___
125
155
 
@@ -143,7 +173,30 @@ canvas 转 blob 文件
143
173
 
144
174
  #### Defined in
145
175
 
146
- [canvasToBlob.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/canvasToBlob.ts#L4)
176
+ [canvasToBlob.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/canvasToBlob.ts#L4)
177
+
178
+ ___
179
+
180
+ ### capitalize
181
+
182
+ ▸ **capitalize**(`str`): `string`
183
+
184
+ 首字母大写
185
+ capitalize('hello world') => Hello world
186
+
187
+ #### Parameters
188
+
189
+ | Name | Type |
190
+ | :------ | :------ |
191
+ | `str` | `string` |
192
+
193
+ #### Returns
194
+
195
+ `string`
196
+
197
+ #### Defined in
198
+
199
+ capitalize.ts:5
147
200
 
148
201
  ___
149
202
 
@@ -171,7 +224,7 @@ ___
171
224
 
172
225
  #### Defined in
173
226
 
174
- [clone.ts:8](https://github.com/daysnap/utils/blob/5b4aa69/src/clone.ts#L8)
227
+ [clone.ts:8](https://github.com/daysnap/utils/blob/edb8efd/src/clone.ts#L8)
175
228
 
176
229
  ___
177
230
 
@@ -199,7 +252,7 @@ ___
199
252
 
200
253
  #### Defined in
201
254
 
202
- [cloneSimple.ts:7](https://github.com/daysnap/utils/blob/5b4aa69/src/cloneSimple.ts#L7)
255
+ [cloneSimple.ts:7](https://github.com/daysnap/utils/blob/edb8efd/src/cloneSimple.ts#L7)
203
256
 
204
257
  ___
205
258
 
@@ -221,7 +274,7 @@ ___
221
274
 
222
275
  #### Defined in
223
276
 
224
- [createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/createHexColorByHash.ts#L4)
277
+ [createHexColorByHash.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/createHexColorByHash.ts#L4)
225
278
 
226
279
  ___
227
280
 
@@ -247,7 +300,7 @@ ___
247
300
 
248
301
  #### Defined in
249
302
 
250
- [compareVersion.ts:9](https://github.com/daysnap/utils/blob/5b4aa69/src/compareVersion.ts#L9)
303
+ [compareVersion.ts:9](https://github.com/daysnap/utils/blob/edb8efd/src/compareVersion.ts#L9)
251
304
 
252
305
  ___
253
306
 
@@ -269,7 +322,7 @@ ___
269
322
 
270
323
  #### Defined in
271
324
 
272
- [compressImage.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/compressImage.ts#L6)
325
+ [compressImage.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/compressImage.ts#L6)
273
326
 
274
327
  ___
275
328
 
@@ -312,7 +365,7 @@ ___
312
365
 
313
366
  #### Defined in
314
367
 
315
- [debounce.ts:5](https://github.com/daysnap/utils/blob/5b4aa69/src/debounce.ts#L5)
368
+ [debounce.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/debounce.ts#L5)
316
369
 
317
370
  ___
318
371
 
@@ -336,7 +389,7 @@ ___
336
389
 
337
390
  #### Defined in
338
391
 
339
- [downloadFile.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/downloadFile.ts#L4)
392
+ [downloadFile.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/downloadFile.ts#L4)
340
393
 
341
394
  ___
342
395
 
@@ -365,7 +418,7 @@ ___
365
418
 
366
419
  #### Defined in
367
420
 
368
- [each.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/each.ts#L4)
421
+ [each.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/each.ts#L4)
369
422
 
370
423
  ▸ **each**<`T`\>(`data`, `callback`): `void`
371
424
 
@@ -388,7 +441,7 @@ ___
388
441
 
389
442
  #### Defined in
390
443
 
391
- [each.ts:8](https://github.com/daysnap/utils/blob/5b4aa69/src/each.ts#L8)
444
+ [each.ts:8](https://github.com/daysnap/utils/blob/edb8efd/src/each.ts#L8)
392
445
 
393
446
  ___
394
447
 
@@ -410,7 +463,7 @@ ___
410
463
 
411
464
  #### Defined in
412
465
 
413
- [filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/filterBankCardNo.ts#L4)
466
+ [filterBankCardNo.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/filterBankCardNo.ts#L4)
414
467
 
415
468
  ___
416
469
 
@@ -432,7 +485,7 @@ ___
432
485
 
433
486
  #### Defined in
434
487
 
435
- [filterCRLF.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/filterCRLF.ts#L4)
488
+ [filterCRLF.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/filterCRLF.ts#L4)
436
489
 
437
490
  ___
438
491
 
@@ -454,7 +507,7 @@ ___
454
507
 
455
508
  #### Defined in
456
509
 
457
- [filterEmoji.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/filterEmoji.ts#L4)
510
+ [filterEmoji.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/filterEmoji.ts#L4)
458
511
 
459
512
  ___
460
513
 
@@ -476,7 +529,7 @@ ___
476
529
 
477
530
  #### Defined in
478
531
 
479
- [filterIdCard.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/filterIdCard.ts#L4)
532
+ [filterIdCard.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/filterIdCard.ts#L4)
480
533
 
481
534
  ___
482
535
 
@@ -498,7 +551,7 @@ ___
498
551
 
499
552
  #### Defined in
500
553
 
501
- [filterName.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/filterName.ts#L4)
554
+ [filterName.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/filterName.ts#L4)
502
555
 
503
556
  ___
504
557
 
@@ -523,7 +576,7 @@ filterPhone('13177778888', ' ') => 131 **** 8888
523
576
 
524
577
  #### Defined in
525
578
 
526
- [filterPhone.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/filterPhone.ts#L6)
579
+ [filterPhone.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/filterPhone.ts#L6)
527
580
 
528
581
  ___
529
582
 
@@ -546,7 +599,7 @@ ___
546
599
 
547
600
  #### Defined in
548
601
 
549
- [formatAmount.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/formatAmount.ts#L4)
602
+ [formatAmount.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/formatAmount.ts#L4)
550
603
 
551
604
  ___
552
605
 
@@ -569,7 +622,32 @@ ___
569
622
 
570
623
  #### Defined in
571
624
 
572
- [formatDate.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/formatDate.ts#L6)
625
+ [formatDate.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/formatDate.ts#L6)
626
+
627
+ ___
628
+
629
+ ### formatMessage
630
+
631
+ ▸ **formatMessage**(`message`, `keys?`): `string`
632
+
633
+ 格式化消息
634
+ formatMessage({ a: '123', b: { ba: '456' } }, ['a']) => '123'
635
+ formatMessage({ a: '123', b: { ba: '456' } }, ['b.ba']) => '456'
636
+
637
+ #### Parameters
638
+
639
+ | Name | Type |
640
+ | :------ | :------ |
641
+ | `message` | `unknown` |
642
+ | `keys` | `string`[] |
643
+
644
+ #### Returns
645
+
646
+ `string`
647
+
648
+ #### Defined in
649
+
650
+ [formatMessage.ts:11](https://github.com/daysnap/utils/blob/edb8efd/src/formatMessage.ts#L11)
573
651
 
574
652
  ___
575
653
 
@@ -591,7 +669,7 @@ ___
591
669
 
592
670
  #### Defined in
593
671
 
594
- [getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/getBlobByUrl.ts#L4)
672
+ [getBlobByUrl.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/getBlobByUrl.ts#L4)
595
673
 
596
674
  ___
597
675
 
@@ -614,7 +692,7 @@ ___
614
692
 
615
693
  #### Defined in
616
694
 
617
- [storage/index.ts:7](https://github.com/daysnap/utils/blob/5b4aa69/src/storage/index.ts#L7)
695
+ [storage/index.ts:7](https://github.com/daysnap/utils/blob/edb8efd/src/storage/index.ts#L7)
618
696
 
619
697
  ___
620
698
 
@@ -636,7 +714,7 @@ ___
636
714
 
637
715
  #### Defined in
638
716
 
639
- [getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/getDayMillisecond.ts#L4)
717
+ [getDayMillisecond.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/getDayMillisecond.ts#L4)
640
718
 
641
719
  ___
642
720
 
@@ -658,7 +736,7 @@ ___
658
736
 
659
737
  #### Defined in
660
738
 
661
- [getImageInfo.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/getImageInfo.ts#L4)
739
+ [getImageInfo.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/getImageInfo.ts#L4)
662
740
 
663
741
  ___
664
742
 
@@ -681,7 +759,7 @@ ___
681
759
 
682
760
  #### Defined in
683
761
 
684
- [storage/index.ts:7](https://github.com/daysnap/utils/blob/5b4aa69/src/storage/index.ts#L7)
762
+ [storage/index.ts:7](https://github.com/daysnap/utils/blob/edb8efd/src/storage/index.ts#L7)
685
763
 
686
764
  ___
687
765
 
@@ -697,7 +775,7 @@ ___
697
775
 
698
776
  #### Defined in
699
777
 
700
- [getRandomColor.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/getRandomColor.ts#L4)
778
+ [getRandomColor.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/getRandomColor.ts#L4)
701
779
 
702
780
  ___
703
781
 
@@ -719,7 +797,7 @@ ___
719
797
 
720
798
  #### Defined in
721
799
 
722
- [getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/getVideoInfo.ts#L4)
800
+ [getVideoInfo.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/getVideoInfo.ts#L4)
723
801
 
724
802
  ___
725
803
 
@@ -735,7 +813,107 @@ ___
735
813
 
736
814
  #### Defined in
737
815
 
738
- [inBrowser.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/inBrowser.ts#L4)
816
+ [inBrowser.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/inBrowser.ts#L4)
817
+
818
+ ___
819
+
820
+ ### insertLink
821
+
822
+ ▸ **insertLink**(`href`): `Promise`<`HTMLLinkElement`\>
823
+
824
+ 插入 link
825
+
826
+ #### Parameters
827
+
828
+ | Name | Type |
829
+ | :------ | :------ |
830
+ | `href` | `string` |
831
+
832
+ #### Returns
833
+
834
+ `Promise`<`HTMLLinkElement`\>
835
+
836
+ #### Defined in
837
+
838
+ [insertLink.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/insertLink.ts#L4)
839
+
840
+ ▸ **insertLink**(`href`, `callback`): `void`
841
+
842
+ #### Parameters
843
+
844
+ | Name | Type |
845
+ | :------ | :------ |
846
+ | `href` | `string` |
847
+ | `callback` | (`err`: `unknown`, `el`: `HTMLLinkElement`) => `void` |
848
+
849
+ #### Returns
850
+
851
+ `void`
852
+
853
+ #### Defined in
854
+
855
+ [insertLink.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/insertLink.ts#L5)
856
+
857
+ ___
858
+
859
+ ### insertScript
860
+
861
+ ▸ **insertScript**(`src`): `Promise`<`HTMLScriptElement`\>
862
+
863
+ 插入外部 script 标签
864
+
865
+ #### Parameters
866
+
867
+ | Name | Type |
868
+ | :------ | :------ |
869
+ | `src` | `string` |
870
+
871
+ #### Returns
872
+
873
+ `Promise`<`HTMLScriptElement`\>
874
+
875
+ #### Defined in
876
+
877
+ [insertScript.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/insertScript.ts#L4)
878
+
879
+ ▸ **insertScript**(`src`, `callback`): `void`
880
+
881
+ #### Parameters
882
+
883
+ | Name | Type |
884
+ | :------ | :------ |
885
+ | `src` | `string` |
886
+ | `callback` | (`err`: `unknown`, `el`: `HTMLScriptElement`) => `void` |
887
+
888
+ #### Returns
889
+
890
+ `void`
891
+
892
+ #### Defined in
893
+
894
+ [insertScript.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/insertScript.ts#L5)
895
+
896
+ ___
897
+
898
+ ### insertStyle
899
+
900
+ ▸ **insertStyle**(`content`): `HTMLStyleElement`
901
+
902
+ 插入样式
903
+
904
+ #### Parameters
905
+
906
+ | Name | Type |
907
+ | :------ | :------ |
908
+ | `content` | `string` |
909
+
910
+ #### Returns
911
+
912
+ `HTMLStyleElement`
913
+
914
+ #### Defined in
915
+
916
+ [insertStyle.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/insertStyle.ts#L4)
739
917
 
740
918
  ___
741
919
 
@@ -751,7 +929,7 @@ ___
751
929
 
752
930
  #### Defined in
753
931
 
754
- [isAndroid.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isAndroid.ts#L4)
932
+ [isAndroid.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isAndroid.ts#L4)
755
933
 
756
934
  ___
757
935
 
@@ -775,7 +953,7 @@ val is any[]
775
953
 
776
954
  #### Defined in
777
955
 
778
- [isArray.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/isArray.ts#L6)
956
+ [isArray.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/isArray.ts#L6)
779
957
 
780
958
  ___
781
959
 
@@ -797,7 +975,7 @@ val is boolean
797
975
 
798
976
  #### Defined in
799
977
 
800
- [isBoolean.ts:5](https://github.com/daysnap/utils/blob/5b4aa69/src/isBoolean.ts#L5)
978
+ [isBoolean.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/isBoolean.ts#L5)
801
979
 
802
980
  ___
803
981
 
@@ -819,7 +997,7 @@ ___
819
997
 
820
998
  #### Defined in
821
999
 
822
- [isEmail.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isEmail.ts#L4)
1000
+ [isEmail.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isEmail.ts#L4)
823
1001
 
824
1002
  ___
825
1003
 
@@ -841,7 +1019,7 @@ ___
841
1019
 
842
1020
  #### Defined in
843
1021
 
844
- [isEmpty.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/isEmpty.ts#L6)
1022
+ [isEmpty.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/isEmpty.ts#L6)
845
1023
 
846
1024
  ___
847
1025
 
@@ -863,7 +1041,7 @@ ___
863
1041
 
864
1042
  #### Defined in
865
1043
 
866
- [isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/5b4aa69/src/isEmptyObject.ts#L5)
1044
+ [isEmptyObject.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/isEmptyObject.ts#L5)
867
1045
 
868
1046
  ___
869
1047
 
@@ -885,7 +1063,7 @@ val is Error
885
1063
 
886
1064
  #### Defined in
887
1065
 
888
- [isError.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isError.ts#L4)
1066
+ [isError.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isError.ts#L4)
889
1067
 
890
1068
  ___
891
1069
 
@@ -907,7 +1085,7 @@ val is Function
907
1085
 
908
1086
  #### Defined in
909
1087
 
910
- [isFunction.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isFunction.ts#L4)
1088
+ [isFunction.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isFunction.ts#L4)
911
1089
 
912
1090
  ___
913
1091
 
@@ -923,7 +1101,7 @@ ___
923
1101
 
924
1102
  #### Defined in
925
1103
 
926
- [isIOS.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isIOS.ts#L4)
1104
+ [isIOS.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isIOS.ts#L4)
927
1105
 
928
1106
  ___
929
1107
 
@@ -945,7 +1123,7 @@ ___
945
1123
 
946
1124
  #### Defined in
947
1125
 
948
- [isIdCard.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isIdCard.ts#L4)
1126
+ [isIdCard.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isIdCard.ts#L4)
949
1127
 
950
1128
  ___
951
1129
 
@@ -967,7 +1145,7 @@ ___
967
1145
 
968
1146
  #### Defined in
969
1147
 
970
- [isJSONString.ts:7](https://github.com/daysnap/utils/blob/5b4aa69/src/isJSONString.ts#L7)
1148
+ [isJSONString.ts:7](https://github.com/daysnap/utils/blob/edb8efd/src/isJSONString.ts#L7)
971
1149
 
972
1150
  ___
973
1151
 
@@ -989,7 +1167,7 @@ ___
989
1167
 
990
1168
  #### Defined in
991
1169
 
992
- [isLan.ts:5](https://github.com/daysnap/utils/blob/5b4aa69/src/isLan.ts#L5)
1170
+ [isLan.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/isLan.ts#L5)
993
1171
 
994
1172
  ___
995
1173
 
@@ -1011,7 +1189,7 @@ ___
1011
1189
 
1012
1190
  #### Defined in
1013
1191
 
1014
- [isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/5b4aa69/src/isLicenseCode.ts#L5)
1192
+ [isLicenseCode.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/isLicenseCode.ts#L5)
1015
1193
 
1016
1194
  ___
1017
1195
 
@@ -1027,7 +1205,7 @@ ___
1027
1205
 
1028
1206
  #### Defined in
1029
1207
 
1030
- [isMobile.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isMobile.ts#L4)
1208
+ [isMobile.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isMobile.ts#L4)
1031
1209
 
1032
1210
  ___
1033
1211
 
@@ -1049,7 +1227,7 @@ val is null
1049
1227
 
1050
1228
  #### Defined in
1051
1229
 
1052
- [isNull.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isNull.ts#L4)
1230
+ [isNull.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isNull.ts#L4)
1053
1231
 
1054
1232
  ___
1055
1233
 
@@ -1071,7 +1249,7 @@ val is number
1071
1249
 
1072
1250
  #### Defined in
1073
1251
 
1074
- [isNumber.ts:5](https://github.com/daysnap/utils/blob/5b4aa69/src/isNumber.ts#L5)
1252
+ [isNumber.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/isNumber.ts#L5)
1075
1253
 
1076
1254
  ___
1077
1255
 
@@ -1093,7 +1271,7 @@ val is Record<string, any\>
1093
1271
 
1094
1272
  #### Defined in
1095
1273
 
1096
- [isObject.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isObject.ts#L4)
1274
+ [isObject.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isObject.ts#L4)
1097
1275
 
1098
1276
  ___
1099
1277
 
@@ -1115,7 +1293,7 @@ ___
1115
1293
 
1116
1294
  #### Defined in
1117
1295
 
1118
- [isPhone.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isPhone.ts#L4)
1296
+ [isPhone.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isPhone.ts#L4)
1119
1297
 
1120
1298
  ___
1121
1299
 
@@ -1143,7 +1321,7 @@ val is Promise<T\>
1143
1321
 
1144
1322
  #### Defined in
1145
1323
 
1146
- [isPromise.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isPromise.ts#L4)
1324
+ [isPromise.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isPromise.ts#L4)
1147
1325
 
1148
1326
  ___
1149
1327
 
@@ -1165,7 +1343,7 @@ val is RegExp
1165
1343
 
1166
1344
  #### Defined in
1167
1345
 
1168
- [isRegExp.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isRegExp.ts#L4)
1346
+ [isRegExp.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isRegExp.ts#L4)
1169
1347
 
1170
1348
  ___
1171
1349
 
@@ -1187,7 +1365,7 @@ val is string
1187
1365
 
1188
1366
  #### Defined in
1189
1367
 
1190
- [isString.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isString.ts#L4)
1368
+ [isString.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isString.ts#L4)
1191
1369
 
1192
1370
  ___
1193
1371
 
@@ -1209,7 +1387,7 @@ ___
1209
1387
 
1210
1388
  #### Defined in
1211
1389
 
1212
- [isURL.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isURL.ts#L4)
1390
+ [isURL.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isURL.ts#L4)
1213
1391
 
1214
1392
  ___
1215
1393
 
@@ -1231,7 +1409,7 @@ val is undefined
1231
1409
 
1232
1410
  #### Defined in
1233
1411
 
1234
- [isUndefined.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isUndefined.ts#L4)
1412
+ [isUndefined.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isUndefined.ts#L4)
1235
1413
 
1236
1414
  ___
1237
1415
 
@@ -1247,7 +1425,7 @@ ___
1247
1425
 
1248
1426
  #### Defined in
1249
1427
 
1250
- [isWeixin.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/isWeixin.ts#L4)
1428
+ [isWeixin.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/isWeixin.ts#L4)
1251
1429
 
1252
1430
  ___
1253
1431
 
@@ -1269,31 +1447,30 @@ val is Window
1269
1447
 
1270
1448
  #### Defined in
1271
1449
 
1272
- [isWindow.ts:5](https://github.com/daysnap/utils/blob/5b4aa69/src/isWindow.ts#L5)
1450
+ [isWindow.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/isWindow.ts#L5)
1273
1451
 
1274
1452
  ___
1275
1453
 
1276
- ### loadResource
1454
+ ### kebabCase
1277
1455
 
1278
- ▸ **loadResource**(`res`, `type`, `callback?`): `void`
1456
+ ▸ **kebabCase**(`key`): `string`
1279
1457
 
1280
- 加载外部js、css、写入style样式
1458
+ 说明
1459
+ kebabCase('helloWorld') => hello-world
1281
1460
 
1282
1461
  #### Parameters
1283
1462
 
1284
- | Name | Type | Description |
1285
- | :------ | :------ | :------ |
1286
- | `res` | `string` | 资源url或内容 |
1287
- | `type` | ``"style"`` \| ``"js"`` \| ``"css"`` | 类型 |
1288
- | `callback?` | () => `void` | 回调函数 |
1463
+ | Name | Type |
1464
+ | :------ | :------ |
1465
+ | `key` | `string` |
1289
1466
 
1290
1467
  #### Returns
1291
1468
 
1292
- `void`
1469
+ `string`
1293
1470
 
1294
1471
  #### Defined in
1295
1472
 
1296
- [loadResource.ts:9](https://github.com/daysnap/utils/blob/5b4aa69/src/loadResource.ts#L9)
1473
+ kebabCase.ts:5
1297
1474
 
1298
1475
  ___
1299
1476
 
@@ -1323,7 +1500,7 @@ ___
1323
1500
 
1324
1501
  #### Defined in
1325
1502
 
1326
- [omit.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/omit.ts#L4)
1503
+ [omit.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/omit.ts#L4)
1327
1504
 
1328
1505
  ___
1329
1506
 
@@ -1347,7 +1524,7 @@ ___
1347
1524
 
1348
1525
  #### Defined in
1349
1526
 
1350
- [padding.ts:7](https://github.com/daysnap/utils/blob/5b4aa69/src/padding.ts#L7)
1527
+ [padding.ts:7](https://github.com/daysnap/utils/blob/edb8efd/src/padding.ts#L7)
1351
1528
 
1352
1529
  ___
1353
1530
 
@@ -1369,7 +1546,7 @@ ___
1369
1546
 
1370
1547
  #### Defined in
1371
1548
 
1372
- [parseDate.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/parseDate.ts#L4)
1549
+ [parseDate.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/parseDate.ts#L4)
1373
1550
 
1374
1551
  ___
1375
1552
 
@@ -1392,7 +1569,7 @@ ___
1392
1569
 
1393
1570
  #### Defined in
1394
1571
 
1395
- [parseError.ts:8](https://github.com/daysnap/utils/blob/5b4aa69/src/parseError.ts#L8)
1572
+ [parseError.ts:8](https://github.com/daysnap/utils/blob/edb8efd/src/parseError.ts#L8)
1396
1573
 
1397
1574
  ___
1398
1575
 
@@ -1422,7 +1599,7 @@ parseObject('a.b.c', 1) => { a: { b: { c: 1 } } }
1422
1599
 
1423
1600
  #### Defined in
1424
1601
 
1425
- [parseObject.ts:5](https://github.com/daysnap/utils/blob/5b4aa69/src/parseObject.ts#L5)
1602
+ [parseObject.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/parseObject.ts#L5)
1426
1603
 
1427
1604
  ___
1428
1605
 
@@ -1451,7 +1628,7 @@ ___
1451
1628
 
1452
1629
  #### Defined in
1453
1630
 
1454
- [parsePath.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/parsePath.ts#L4)
1631
+ [parsePath.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/parsePath.ts#L6)
1455
1632
 
1456
1633
  ___
1457
1634
 
@@ -1474,7 +1651,30 @@ ___
1474
1651
 
1475
1652
  #### Defined in
1476
1653
 
1477
- [parseQuery.ts:8](https://github.com/daysnap/utils/blob/5b4aa69/src/parseQuery.ts#L8)
1654
+ [parseQuery.ts:8](https://github.com/daysnap/utils/blob/edb8efd/src/parseQuery.ts#L8)
1655
+
1656
+ ___
1657
+
1658
+ ### pascalCase
1659
+
1660
+ ▸ **pascalCase**(`str`): `string`
1661
+
1662
+ 首字母大写的驼峰
1663
+ pascalCase('hello-world') => HelloWorld
1664
+
1665
+ #### Parameters
1666
+
1667
+ | Name | Type |
1668
+ | :------ | :------ |
1669
+ | `str` | `string` |
1670
+
1671
+ #### Returns
1672
+
1673
+ `string`
1674
+
1675
+ #### Defined in
1676
+
1677
+ pascalCase.ts:8
1478
1678
 
1479
1679
  ___
1480
1680
 
@@ -1504,7 +1704,7 @@ ___
1504
1704
 
1505
1705
  #### Defined in
1506
1706
 
1507
- [pick.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/pick.ts#L4)
1707
+ [pick.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/pick.ts#L4)
1508
1708
 
1509
1709
  ___
1510
1710
 
@@ -1527,7 +1727,7 @@ ___
1527
1727
 
1528
1728
  #### Defined in
1529
1729
 
1530
- [replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/5b4aa69/src/replaceCrlf.ts#L4)
1730
+ [replaceCrlf.ts:4](https://github.com/daysnap/utils/blob/edb8efd/src/replaceCrlf.ts#L4)
1531
1731
 
1532
1732
  ___
1533
1733
 
@@ -1553,7 +1753,7 @@ reserve(0, '--') => 0
1553
1753
 
1554
1754
  #### Defined in
1555
1755
 
1556
- [reserve.ts:8](https://github.com/daysnap/utils/blob/5b4aa69/src/reserve.ts#L8)
1756
+ [reserve.ts:8](https://github.com/daysnap/utils/blob/edb8efd/src/reserve.ts#L8)
1557
1757
 
1558
1758
  ___
1559
1759
 
@@ -1576,7 +1776,7 @@ ___
1576
1776
 
1577
1777
  #### Defined in
1578
1778
 
1579
- [round.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/round.ts#L6)
1779
+ [round.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/round.ts#L6)
1580
1780
 
1581
1781
  ___
1582
1782
 
@@ -1599,7 +1799,7 @@ ___
1599
1799
 
1600
1800
  #### Defined in
1601
1801
 
1602
- [sleep.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/sleep.ts#L6)
1802
+ [sleep.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/sleep.ts#L6)
1603
1803
 
1604
1804
  ___
1605
1805
 
@@ -1622,7 +1822,7 @@ ___
1622
1822
 
1623
1823
  #### Defined in
1624
1824
 
1625
- [stringTrim.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/stringTrim.ts#L6)
1825
+ [stringTrim.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/stringTrim.ts#L6)
1626
1826
 
1627
1827
  ___
1628
1828
 
@@ -1644,7 +1844,7 @@ ___
1644
1844
 
1645
1845
  #### Defined in
1646
1846
 
1647
- [stringifyQuery.ts:7](https://github.com/daysnap/utils/blob/5b4aa69/src/stringifyQuery.ts#L7)
1847
+ [stringifyQuery.ts:7](https://github.com/daysnap/utils/blob/edb8efd/src/stringifyQuery.ts#L7)
1648
1848
 
1649
1849
  ___
1650
1850
 
@@ -1659,7 +1859,7 @@ ___
1659
1859
 
1660
1860
  | Name | Type |
1661
1861
  | :------ | :------ |
1662
- | `T` | extends (...`args`: []) => `any` |
1862
+ | `T` | extends (...`args`: `any`[]) => `any` |
1663
1863
 
1664
1864
  #### Parameters
1665
1865
 
@@ -1687,7 +1887,7 @@ ___
1687
1887
 
1688
1888
  #### Defined in
1689
1889
 
1690
- [throttle.ts:5](https://github.com/daysnap/utils/blob/5b4aa69/src/throttle.ts#L5)
1890
+ [throttle.ts:5](https://github.com/daysnap/utils/blob/edb8efd/src/throttle.ts#L5)
1691
1891
 
1692
1892
  ___
1693
1893
 
@@ -1711,4 +1911,4 @@ ___
1711
1911
 
1712
1912
  #### Defined in
1713
1913
 
1714
- [typeOf.ts:6](https://github.com/daysnap/utils/blob/5b4aa69/src/typeOf.ts#L6)
1914
+ [typeOf.ts:6](https://github.com/daysnap/utils/blob/edb8efd/src/typeOf.ts#L6)
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 驼峰
3
+ * camelCase('hello-world') => helloWorld
4
+ */
5
+ export declare function camelCase(str: string): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 驼峰
3
+ * camelCase('hello-world') => helloWorld
4
+ */
5
+ export function camelCase(str) {
6
+ return str.replace(/-(\w)/g, (_, c) => (c ? c.toUpperCase() : ''));
7
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 首字母大写
3
+ * capitalize('hello world') => Hello world
4
+ */
5
+ export declare function capitalize(str: string): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 首字母大写
3
+ * capitalize('hello world') => Hello world
4
+ */
5
+ export function capitalize(str) {
6
+ return str.charAt(0).toUpperCase() + str.slice(1);
7
+ }
package/es/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './base64ToBlob';
2
2
  export * from './blobToBase64';
3
+ export * from './camelCase';
3
4
  export * from './canvasToBlob';
5
+ export * from './capitalize';
4
6
  export * from './clone';
5
7
  export * from './cloneSimple';
6
8
  export * from './compareVersion';
@@ -52,6 +54,7 @@ export * from './isURL';
52
54
  export * from './isUndefined';
53
55
  export * from './isWeixin';
54
56
  export * from './isWindow';
57
+ export * from './kebabCase';
55
58
  export * from './omit';
56
59
  export * from './padding';
57
60
  export * from './parseDate';
@@ -59,6 +62,7 @@ export * from './parseError';
59
62
  export * from './parseObject';
60
63
  export * from './parsePath';
61
64
  export * from './parseQuery';
65
+ export * from './pascalCase';
62
66
  export * from './pick';
63
67
  export * from './replaceCrlf';
64
68
  export * from './reserve';
package/es/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  /* 本文件自动生成 './scripts/entry.js' */
2
2
  export * from './base64ToBlob';
3
3
  export * from './blobToBase64';
4
+ export * from './camelCase';
4
5
  export * from './canvasToBlob';
6
+ export * from './capitalize';
5
7
  export * from './clone';
6
8
  export * from './cloneSimple';
7
9
  export * from './compareVersion';
@@ -53,6 +55,7 @@ export * from './isURL';
53
55
  export * from './isUndefined';
54
56
  export * from './isWeixin';
55
57
  export * from './isWindow';
58
+ export * from './kebabCase';
56
59
  export * from './omit';
57
60
  export * from './padding';
58
61
  export * from './parseDate';
@@ -60,6 +63,7 @@ export * from './parseError';
60
63
  export * from './parseObject';
61
64
  export * from './parsePath';
62
65
  export * from './parseQuery';
66
+ export * from './pascalCase';
63
67
  export * from './pick';
64
68
  export * from './replaceCrlf';
65
69
  export * from './reserve';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 说明
3
+ * kebabCase('helloWorld') => hello-world
4
+ */
5
+ export declare function kebabCase(key: string): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 说明
3
+ * kebabCase('helloWorld') => hello-world
4
+ */
5
+ export function kebabCase(key) {
6
+ const result = key.replace(/([A-Z])/g, ' $1').trim();
7
+ return result.split(' ').join('-').toLowerCase();
8
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 首字母大写的驼峰
3
+ * pascalCase('hello-world') => HelloWorld
4
+ */
5
+ export declare function pascalCase(str: string): string;
@@ -0,0 +1,9 @@
1
+ import { camelCase } from './camelCase';
2
+ import { capitalize } from './capitalize';
3
+ /**
4
+ * 首字母大写的驼峰
5
+ * pascalCase('hello-world') => HelloWorld
6
+ */
7
+ export function pascalCase(str) {
8
+ return capitalize(camelCase(str));
9
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 驼峰
3
+ * camelCase('hello-world') => helloWorld
4
+ */
5
+ export declare function camelCase(str: string): string;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.camelCase = void 0;
4
+ /**
5
+ * 驼峰
6
+ * camelCase('hello-world') => helloWorld
7
+ */
8
+ function camelCase(str) {
9
+ return str.replace(/-(\w)/g, (_, c) => (c ? c.toUpperCase() : ''));
10
+ }
11
+ exports.camelCase = camelCase;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 首字母大写
3
+ * capitalize('hello world') => Hello world
4
+ */
5
+ export declare function capitalize(str: string): string;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.capitalize = void 0;
4
+ /**
5
+ * 首字母大写
6
+ * capitalize('hello world') => Hello world
7
+ */
8
+ function capitalize(str) {
9
+ return str.charAt(0).toUpperCase() + str.slice(1);
10
+ }
11
+ exports.capitalize = capitalize;
package/lib/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './base64ToBlob';
2
2
  export * from './blobToBase64';
3
+ export * from './camelCase';
3
4
  export * from './canvasToBlob';
5
+ export * from './capitalize';
4
6
  export * from './clone';
5
7
  export * from './cloneSimple';
6
8
  export * from './compareVersion';
@@ -52,6 +54,7 @@ export * from './isURL';
52
54
  export * from './isUndefined';
53
55
  export * from './isWeixin';
54
56
  export * from './isWindow';
57
+ export * from './kebabCase';
55
58
  export * from './omit';
56
59
  export * from './padding';
57
60
  export * from './parseDate';
@@ -59,6 +62,7 @@ export * from './parseError';
59
62
  export * from './parseObject';
60
63
  export * from './parsePath';
61
64
  export * from './parseQuery';
65
+ export * from './pascalCase';
62
66
  export * from './pick';
63
67
  export * from './replaceCrlf';
64
68
  export * from './reserve';
package/lib/index.js CHANGED
@@ -17,7 +17,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  __exportStar(require("./base64ToBlob"), exports);
19
19
  __exportStar(require("./blobToBase64"), exports);
20
+ __exportStar(require("./camelCase"), exports);
20
21
  __exportStar(require("./canvasToBlob"), exports);
22
+ __exportStar(require("./capitalize"), exports);
21
23
  __exportStar(require("./clone"), exports);
22
24
  __exportStar(require("./cloneSimple"), exports);
23
25
  __exportStar(require("./compareVersion"), exports);
@@ -69,6 +71,7 @@ __exportStar(require("./isURL"), exports);
69
71
  __exportStar(require("./isUndefined"), exports);
70
72
  __exportStar(require("./isWeixin"), exports);
71
73
  __exportStar(require("./isWindow"), exports);
74
+ __exportStar(require("./kebabCase"), exports);
72
75
  __exportStar(require("./omit"), exports);
73
76
  __exportStar(require("./padding"), exports);
74
77
  __exportStar(require("./parseDate"), exports);
@@ -76,6 +79,7 @@ __exportStar(require("./parseError"), exports);
76
79
  __exportStar(require("./parseObject"), exports);
77
80
  __exportStar(require("./parsePath"), exports);
78
81
  __exportStar(require("./parseQuery"), exports);
82
+ __exportStar(require("./pascalCase"), exports);
79
83
  __exportStar(require("./pick"), exports);
80
84
  __exportStar(require("./replaceCrlf"), exports);
81
85
  __exportStar(require("./reserve"), exports);
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 说明
3
+ * kebabCase('helloWorld') => hello-world
4
+ */
5
+ export declare function kebabCase(key: string): string;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.kebabCase = void 0;
4
+ /**
5
+ * 说明
6
+ * kebabCase('helloWorld') => hello-world
7
+ */
8
+ function kebabCase(key) {
9
+ const result = key.replace(/([A-Z])/g, ' $1').trim();
10
+ return result.split(' ').join('-').toLowerCase();
11
+ }
12
+ exports.kebabCase = kebabCase;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 首字母大写的驼峰
3
+ * pascalCase('hello-world') => HelloWorld
4
+ */
5
+ export declare function pascalCase(str: string): string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pascalCase = void 0;
4
+ const camelCase_1 = require("./camelCase");
5
+ const capitalize_1 = require("./capitalize");
6
+ /**
7
+ * 首字母大写的驼峰
8
+ * pascalCase('hello-world') => HelloWorld
9
+ */
10
+ function pascalCase(str) {
11
+ return (0, capitalize_1.capitalize)((0, camelCase_1.camelCase)(str));
12
+ }
13
+ exports.pascalCase = pascalCase;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daysnap/utils",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "description": "通用的工具库",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",