2
2
3
3
[ ![ npm version] [ npm-version-src ]] [ npm-version-href ]
4
4
[ ![ npm downloads] [ npm-downloads-src ]] [ npm-downloads-href ]
5
- [ ![ Github Actions] [ github-actions-src ]] [ github-actions-href ]
6
- [ ![ Codecov] [ codecov-src ]] [ codecov-href ]
7
5
[ ![ bundle] [ bundle-src ]] [ bundle-href ]
6
+ [ ![ Codecov] [ codecov-src ]] [ codecov-href ]
8
7
9
8
<!--  -->
10
9
@@ -14,8 +13,6 @@ Install using npm or yarn:
14
13
15
14
``` bash
16
15
npm i scule
17
- # or
18
- yarn add scule
19
16
```
20
17
21
18
Import:
@@ -28,41 +25,67 @@ const { pascalCase } = require('scule')
28
25
import { pascalCase } from ' scule'
29
26
```
30
27
31
- ** Notice:** You may need to transpile package for legacy environments
28
+ ** Notice:** You may need to transpile package for legacy environments.
32
29
33
30
## Utils
34
31
35
32
### ` pascalCase(str) `
36
33
37
- Splits string and joins by PascalCase convention ( ` foo-bar ` => ` FooBar ` )
34
+ Splits string and joins by PascalCase convention:
38
35
39
- ** Remarks:**
36
+ ``` ts
37
+ pascalCase (' foo-bar_baz' )
38
+ // FooBarBaz
39
+ ```
40
40
41
- - If an uppercase letter is followed by other uppercase letters (like ` FooBAR ` ), they are preserved
41
+ ** Notice: ** If an uppercase letter is followed by other uppercase letters (like ` FooBAR ` ), they are preserved.
42
42
43
43
### ` camelCase `
44
44
45
- Splits string and joins by camelCase convention (` foo-bar ` => ` fooBar ` )
45
+ Splits string and joins by camelCase convention:
46
+
47
+ ``` ts
48
+ camelCase (' foo-bar_baz' )
49
+ // fooBarBaz
50
+ ```
46
51
47
52
### ` kebabCase(str) `
48
53
49
- Splits string and joins by kebab-case convention ( ` fooBar ` => ` foo-bar ` )
54
+ Splits string and joins by kebab-case convention:
50
55
51
- ** Remarks:**
56
+ ``` ts
57
+ kebabCase (' fooBar_Baz' )
58
+ // foo-bar-baz
59
+ ```
52
60
53
- - It does ** not** preserve case
61
+ ** Notice: ** It does ** not** preserve case.
54
62
55
63
### ` snakeCase `
56
64
57
- Splits string and joins by snake_case convention (` foo-bar ` => ` foo_bar ` )
65
+ Splits string and joins by snake_case convention:
66
+
67
+ ``` ts
68
+ snakeCase (' foo-barBaz' )
69
+ // foo_bar_baz
70
+ ```
58
71
59
72
### ` upperFirst(str) `
60
73
61
- Converts first character to upper case
74
+ Converts first character to upper case:
75
+
76
+ ``` ts
77
+ upperFirst (' hello world!' )
78
+ // Hello world!
79
+ ```
62
80
63
81
### ` lowerFirst(str) `
64
82
65
- Converts first character to lower case
83
+ Converts first character to lower case:
84
+
85
+ ``` ts
86
+ lowerFirst (' Hello world!' )
87
+ // hello world!
88
+ ```
66
89
67
90
### ` splitByCase(str, splitters?) `
68
91
@@ -85,17 +108,11 @@ Converts first character to lower case
85
108
[ MIT] ( ./LICENSE )
86
109
87
110
<!-- Badges -->
88
- [ npm-version-src ] : https://img.shields.io/npm/v/scule?style=flat-square
111
+ [ npm-version-src ] : https://img.shields.io/npm/v/scule?style=flat&colorA=18181B&colorB=F0DB4F
89
112
[ npm-version-href ] : https://npmjs.com/package/scule
90
-
91
- [ npm-downloads-src ] : https://img.shields.io/npm/dm/scule?style=flat-square
113
+ [ npm-downloads-src ] : https://img.shields.io/npm/dm/scule?style=flat&colorA=18181B&colorB=F0DB4F
92
114
[ npm-downloads-href ] : https://npmjs.com/package/scule
93
-
94
- [ github-actions-src ] : https://img.shields.io/github/workflow/status/unjs/scule/ci/main?style=flat-square
95
- [ github-actions-href ] : https://github.com/unjs/scule/actions?query=workflow%3Aci
96
-
97
- [ codecov-src ] : https://img.shields.io/codecov/c/gh/unjs/scule/main?style=flat-square
115
+ [ codecov-src ] : https://img.shields.io/codecov/c/gh/unjs/scule/main?style=flat&colorA=18181B&colorB=F0DB4F
98
116
[ codecov-href ] : https://codecov.io/gh/unjs/scule
99
-
100
- [ bundle-src ] : https://img.shields.io/bundlephobia/minzip/scule?style=flat-square
117
+ [ bundle-src ] : https://img.shields.io/bundlephobia/minzip/scule?style=flat&colorA=18181B&colorB=F0DB4F
101
118
[ bundle-href ] : https://bundlephobia.com/result?p=scule
0 commit comments