Skip to content

sovarim/2-camel-case

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2-camel-case

Converting an object or array of any nesting level to camelcase style

Installation

$ npm install 2-camel-case

or

$ yarn add 2-camel-case

Example

import toCamelCase from '2-camel-case';

toCamelCase({
  first_name: 'Ivan',
  middle_name: 'Ivanovich',
  last_name: 'Ivanov',
});
/* 
  return {
    firstName: 'Ivan',
    middleName: 'Ivanovich',
    lastName: 'Ivanov', 
  }
*/

toCamelCase([
  {
    first_name: 'Ivan',
    middle_name: 'Ivanovich',
    last_name: 'Ivanov',
  },
]);
/* 
  return [
  {
    firstName: 'Ivan',
    middleName: 'Ivanovich',
    lastName: 'Ivanov',
  },
]
*/

API

toCameCase(data)

data

Type: array | object

About

Converting an object or array to the camelcase style

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published