File tree Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ const camelCased = toCamelCaseKeys(obj);
1212
1313### ` toCamelCaseKeys(obj) `
1414
15- オブジェクトのすべてのキーをキャメルケースに変換したい時に` toCamelCaseKeys ` を使用してください。ネストされたオブジェクトと配列内のオブジェクトも再帰的に変換されます。
15+ オブジェクトのすべてのキーをキャメルケースに変換したい時に ` toCamelCaseKeys ` を使用してください。ネストされたオブジェクトと配列内のオブジェクトも再帰的に変換されます。
16+
17+ - ` snake_case ` → ` camelCase ` (例: ` user_id ` → ` userId ` )
18+ - ` PascalCase ` → ` camelCase ` (例: ` UserId ` → ` userId ` )
19+ - ` ALL_CAPS ` → ` camelCase ` (例: ` FIRST_NAME ` → ` firstName ` , ` LAST ` → ` last ` )
1620
1721``` typescript
1822import { toCamelCaseKeys } from ' es-toolkit/object' ;
@@ -50,6 +54,11 @@ const nestedResult = toCamelCaseKeys(nested);
5054// }
5155// }
5256// }になります
57+
58+ // PascalCase と ALL_CAPS のキーも変換されます
59+ const raw = { UserId: 1 , FIRST_NAME: ' JinHo' , LAST: ' Yeom' };
60+ const converted = toCamelCaseKeys (raw );
61+ // converted は { userId: 1, firstName: 'JinHo', last: 'Yeom' } になります
5362```
5463
5564#### パラメータ
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ const camelCased = toCamelCaseKeys(obj);
1414
1515객체의 모든 키를 카멜 케이스로 변환하고 싶을 때 ` toCamelCaseKeys ` 를 사용하세요. 중첩된 객체와 배열 내의 객체들도 재귀적으로 변환돼요.
1616
17+ - ` snake_case ` → ` camelCase ` (예: ` user_id ` → ` userId ` )
18+ - ` PascalCase ` → ` camelCase ` (예: ` UserId ` → ` userId ` )
19+ - ` ALL_CAPS ` → ` camelCase ` (예: ` FIRST_NAME ` → ` firstName ` , ` LAST ` → ` last ` )
20+
1721``` typescript
1822import { toCamelCaseKeys } from ' es-toolkit/object' ;
1923
@@ -50,6 +54,11 @@ const nestedResult = toCamelCaseKeys(nested);
5054// }
5155// }
5256// }가 돼요
57+
58+ // PascalCase와 ALL_CAPS 키도 변환돼요
59+ const raw = { UserId: 1 , FIRST_NAME: ' JinHo' , LAST: ' Yeom' };
60+ const converted = toCamelCaseKeys (raw );
61+ // converted는 { userId: 1, firstName: 'JinHo', last: 'Yeom' }가 돼요
5362```
5463
5564#### 파라미터
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ const camelCased = toCamelCaseKeys(obj);
1414
1515Use ` toCamelCaseKeys ` when you want to convert all keys of an object to camel case. Nested objects and objects within arrays are also converted recursively.
1616
17+ - ` snake_case ` → ` camelCase ` (e.g. ` user_id ` → ` userId ` )
18+ - ` PascalCase ` → ` camelCase ` (e.g. ` UserId ` → ` userId ` )
19+ - ` ALL_CAPS ` → ` camelCase ` (e.g. ` FIRST_NAME ` → ` firstName ` , ` LAST ` → ` last ` )
20+
1721``` typescript
1822import { toCamelCaseKeys } from ' es-toolkit/object' ;
1923
@@ -50,6 +54,11 @@ const nestedResult = toCamelCaseKeys(nested);
5054// }
5155// }
5256// }
57+
58+ // PascalCase and ALL_CAPS keys are also converted
59+ const raw = { UserId: 1 , FIRST_NAME: ' JinHo' , LAST: ' Yeom' };
60+ const converted = toCamelCaseKeys (raw );
61+ // converted is { userId: 1, firstName: 'JinHo', last: 'Yeom' }
5362```
5463
5564#### Parameters
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ const camelCased = toCamelCaseKeys(obj);
1414
1515当您想要将对象的所有键转换为驼峰命名法时,请使用 ` toCamelCaseKeys ` 。嵌套对象和数组中的对象也会递归转换。
1616
17+ - ` snake_case ` → ` camelCase ` (例如 ` user_id ` → ` userId ` )
18+ - ` PascalCase ` → ` camelCase ` (例如 ` UserId ` → ` userId ` )
19+ - ` ALL_CAPS ` → ` camelCase ` (例如 ` FIRST_NAME ` → ` firstName ` , ` LAST ` → ` last ` )
20+
1721``` typescript
1822import { toCamelCaseKeys } from ' es-toolkit/object' ;
1923
@@ -50,6 +54,11 @@ const nestedResult = toCamelCaseKeys(nested);
5054// }
5155// }
5256// }
57+
58+ // PascalCase 和 ALL_CAPS 的键也会被转换
59+ const raw = { UserId: 1 , FIRST_NAME: ' JinHo' , LAST: ' Yeom' };
60+ const converted = toCamelCaseKeys (raw );
61+ // converted 是 { userId: 1, firstName: 'JinHo', last: 'Yeom' }
5362```
5463
5564#### 参数
You can’t perform that action at this time.
0 commit comments