Loading homepage
Convert the keys of a JSON-compatible value to camel case, including objects nested inside arrays. Keep the values intact and build fresh containers without mutating the input.
JavaScript and TypeScript use the same contract.
Input: { "user_name": "Ada", "API_URL": "/users" } Output: { "userName": "Ada", "apiUrl": "/users" }
Input: { "user_profile": { "first-name": "Ada" }, "all_users": [{ "user_id": 1 }] } Output: { "userProfile": { "firstName": "Ada" }, "allUsers": [{ "userId": 1 }] }
Input: { "first_name": 1, "first-name": 2 } Output: { "firstName": 2 }
Examples illustrate the function contract and expected behavior.