toPascalCaseKeys es-toolkit
Returns a new object with all keys in objects and arrays converted to PascalCase.
Pascal case is a naming convention where each word in an identifier is capitalized and concatenated. For example, it's written as PascalCase.
Usage
toPascalCaseKeys(obj)
Use toPascalCaseKeys when you want to convert all keys of an object to pascal case. Nested objects and objects within arrays are also converted recursively.
For example, object keys are converted as follows:
snake_case→PascalCase(e.g.user_id→UserId)camelCase→PascalCase(e.g.UserId→UserId)UPPERCASE_KEYS→PascalCase(e.g.FIRST_NAME→FirstName,LAST→Last)
Parameters
The object, array, or primitive value to convert keys to PascalCase.
Returns
Returns a new object with all keys converted to PascalCase.
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.