Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 617 Bytes

keysToCamelCase.md

File metadata and controls

28 lines (22 loc) · 617 Bytes

keysToCamelCase (source code)

  • Curried: false
  • Failsafe status: failsafe by default

The keysToCamelCase function recursively converts the snake-cased object keys to camel case.

Arguments:

  • object: An object with snake_case keys.

Usage:

keysToCamelCase({
  first_name: "Oliver",
  last_name: "Smith",
  address: { city: "Miami", phone_number: "389791382" },
});
/*
{
  address: {city: 'Miami', phoneNumber: '389791382'},
  firstName: "Oliver",
  lastName: "Smith",
}
*/