keysToCamelCase (source code)
- Curried: false
- Failsafe status: failsafe by default
The keysToCamelCase
function recursively converts the snake-cased object keys
to camel case.
object
: An object withsnake_case
keys.
keysToCamelCase({
first_name: "Oliver",
last_name: "Smith",
address: { city: "Miami", phone_number: "389791382" },
});
/*
{
address: {city: 'Miami', phoneNumber: '389791382'},
firstName: "Oliver",
lastName: "Smith",
}
*/