hm-change-case-object

1.0.1 • Public • Published

change-case-object

Build Status Dependency Status devDependency Status Coverage Status Code Climate

Changes the case of all object's keys,Array,String

Installation

npm install change-case-object Currently, only CommonJS environments are supported. (This means Node.js and browser with browserify or webpack)

Example

var changeCaseObject = require('change-case-object');
 
var myObject = {
  hello_world: 'hi',
};
 
var newObject = changeCaseObject.camelCase(myObject);
// {helloWorld: 'hi'}

Methods

All methods are available under the changeCaseObject object after the module has been required.

.camelCase

Conerts all object keys into camel case.
hello_world -> helloWorld

.snakeCase

Conerts all object keys into snake case.
helloWorld -> hello_world

.paramCase

Conerts all object keys into param case.
helloWorld -> hello-world

Shorthand methods are also available:

.camelCase -> .camel
.snakeCase -> .snake
.paramCase -> .param

Code Guideline

AirBnB ES5

License

MIT

Dependencies (3)

Dev Dependencies (7)

Package Sidebar

Install

npm i hm-change-case-object

Weekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • safiresh