feat(upperFirst, lowerFirst): Add some docs for lowerFirst & upperFirst

This commit is contained in:
raon0211 2024-08-25 22:22:21 +09:00
parent 33bce8af73
commit 6ef87e318b
9 changed files with 118 additions and 193 deletions

View File

@ -214,6 +214,8 @@ function sidebar(): DefaultTheme.Sidebar {
{ text: 'startCase', link: '/reference/string/startCase' },
{ text: 'pascalCase', link: '/reference/string/pascalCase' },
{ text: 'capitalize', link: '/reference/string/capitalize' },
{ text: 'lowerFirst', link: '/reference/string/lowerFirst' },
{ text: 'upperFirst', link: '/reference/string/upperFirst' },
{ text: 'startsWith (compat)', link: '/reference/compat/string/startsWith' },
{ text: 'endsWith (compat)', link: '/reference/compat/string/endsWith' },
{ text: 'padStart (compat)', link: '/reference/compat/string/padStart' },

View File

@ -227,6 +227,8 @@ function sidebar(): DefaultTheme.Sidebar {
{ text: 'startCase', link: '/ko/reference/string/startCase' },
{ text: 'pascalCase', link: '/ko/reference/string/pascalCase' },
{ text: 'capitalize', link: '/ko/reference/string/capitalize' },
{ text: 'lowerFirst', link: '/ko/reference/string/lowerFirst' },
{ text: 'upperFirst', link: '/ko/reference/string/upperFirst' },
{ text: 'startsWith (호환성)', link: '/ko/reference/compat/string/startsWith' },
{ text: 'endsWith (호환성)', link: '/ko/reference/compat/string/endsWith' },
{ text: 'padStart (호환성)', link: '/ko/reference/compat/string/padStart' },

View File

@ -210,6 +210,8 @@ function sidebar(): DefaultTheme.Sidebar {
{ text: 'startCase', link: '/zh_hans/reference/string/startCase' },
{ text: 'pascalCase', link: '/zh_hans/reference/string/pascalCase' },
{ text: 'capitalize', link: '/zh_hans/reference/string/capitalize' },
{ text: 'lowerFirst', link: '/zh_hans/reference/string/lowerFirst' },
{ text: 'upperFirst', link: '/zh_hans/reference/string/upperFirst' },
{ text: 'startsWith (兼容性)', link: '/zh_hans/reference/compat/string/startsWith' },
{ text: 'endsWith (兼容性)', link: '/zh_hans/reference/compat/string/endsWith' },
{ text: 'padStart (兼容性)', link: '/zh_hans/reference/compat/string/padStart' },

View File

@ -0,0 +1,27 @@
# lowerFirst
문자열의 첫 글자를 소문자로 바꿔요.
## 인터페이스
```typescript
function lowerFirst(str: string): string;
```
### 파라미터
- `str` (`string`): 바꿀 문자열.
### 반환 값
(`string`) 첫 글자가 소문자로 바뀐 문자열.
## 예시
```typescript
import { lowerFirst } from 'es-toolkit/string';
lowerFirst('fred'); // 반환 값은 'fred'
lowerFirst('Fred'); // 반환 값은 'fred'
lowerFirst('FRED'); // 반환 값은 'fRED'
```

View File

@ -0,0 +1,27 @@
# upperFirst
문자열의 첫 글자를 대문자로 바꿔요.
## 인터페이스
```typescript
function upperFirst(str: string): string;
```
### 파라미터
- `str` (`string`): 바꿀 문자열.
### 반환 값
(`string`) 첫 글자가 대문자로 바뀐 문자열.
## 예시
```typescript
import { upperFirst } from 'es-toolkit/string';
upperFirst('fred') // 반환 값은 'Fred'
upperFirst('Fred') // 반환 값은 'Fred'
upperFirst('FRED') // 반환 값은 'FRED'
```

View File

@ -21,6 +21,7 @@ function lowerFirst(str: string): string;
```typescript
import { lowerFirst } from 'es-toolkit/string';
upperCase('Fred') // returns 'fred'
upperCase('FRED') // returns 'fRED'
```
lowerFirst('fred'); // returns 'fred'
lowerFirst('Fred'); // returns 'fred'
lowerFirst('FRED'); // returns 'fRED'
```

View File

@ -0,0 +1,27 @@
# lowerFirst
将字符串的第一个字符转换为小写。
## 签名
```typescript
function lowerFirst(str: string): string;
```
### 参数
- `str` (`string`): 要修改的字符串。
### 返回值
(`string`): 转换后的字符串。
## 示例
```typescript
import { lowerFirst } from 'es-toolkit/string';
lowerFirst('fred'); // 返回 'fred'
lowerFirst('Fred'); // 返回 'fred'
lowerFirst('FRED'); // 返回 'fRED'
```

View File

@ -0,0 +1,27 @@
# upperFirst
将字符串的第一个字符转换为大写。
## 签名
```typescript
function upperFirst(str: string): string;
```
### 参数
- `str` (`string`): 要修改的字符串。
### 返回值
(`string`): 转换后的字符串。
## 示例
```typescript
import { upperFirst } from 'es-toolkit/string';
upperFirst('fred') // 返回 'Fred'
upperFirst('Fred') // 返回 'Fred'
upperFirst('FRED') // 返回 'FRED'
```

File diff suppressed because one or more lines are too long