GithubHelp home page GithubHelp logo

ito-p / change-case-object Goto Github PK

View Code? Open in Web Editor NEW

This project forked from binarythumb/change-case-object

0.0 1.0 0.0 21 KB

Changes the case of all keys in an object

License: MIT License

JavaScript 100.00%

change-case-object's Introduction

change-case-object

Build Status Dependency Status devDependency Status Coverage Status Code Climate

Recursively changes the case of all keys in an object or array. In its simplest form it also changes the key itself if a string is passed in.

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

Changelog

2.0.0 Object values are no longer being transformed by default 1.1.1 Stricter checking for code guideline
1.1.0 Add support for arrays and primitives
1.0.0 Initial version

change-case-object's People

Contributors

frostney avatar ito-p avatar nabati avatar safiresh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.