toKebabCaseKeys es-toolkit
Returns a new object with all keys in objects and arrays converted to kebab-case.
Kebab case is a naming convention where each word is written in lowercase and connected with dashes (-). For example, it's written as kebab-case.
Usage
toKebabCaseKeys(obj)
Use toKebabCaseKeys when you want to convert all keys of an object to kebab-case. Nested objects and objects within arrays are also converted recursively.
For example, object keys are converted as follows:
camelCase→kebab-case(e.g.userId→user-id)PascalCase→kebab-case(e.g.UserId→user-id)UPPERCASE_KEYS→kebab-case(e.g.FIRST_NAME→first-name,LAST→last)
Parameters
The object, array, or primitive value to convert keys to kebab-case.
Returns
Returns a new object with all keys converted to kebab-case.
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.