toCamelCaseKeys es-toolkit
Returns a new object with all keys in objects and arrays converted to camelCase.
Camel case is a naming convention where the first word is lowercase and the first letter of subsequent words is capitalized and concatenated. For example, it's written as camelCase.
Usage
toCamelCaseKeys(obj)
Use toCamelCaseKeys when you want to convert all keys of an object to camel case. Nested objects and objects within arrays are also converted recursively.
For example, object keys are converted as follows:
snake_case→camelCase(e.g.user_id→userId)PascalCase→camelCase(e.g.UserId→userId)UPPERCASE_KEYS→camelCase(e.g.FIRST_NAME→firstName,LAST→last)
Parameters
The object, array, or primitive value to convert keys to camelCase.
Returns
Returns a new object with all keys converted to camelCase.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.