Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

penrillian-camelize

1.0.0 • Public • Published

penrillian-camelize

Recursively transform key strings to camel-case.

example

var camelize = require('camelize');
var obj = {
    fee_fie_foe: 'fum',
    beep_boop: [
        { "KeyID": "abc" },
        { 'abc.xyz': 'mno' },
        { 'foo-bar': 'baz' }
    ]
};
var res = camelize(obj);
console.log(JSON.stringify(res, null, 2));

output:

{
  "feeFieFoe": "fum",
  "beepBoop": [
    {
      "keyId": "abc"
    },
    {
      "abcXyz": "mno"
    },
    {
      "fooBar": "baz"
    }
  ]
}

methods

var penrillianCamelize = require('penrillian-camelize')

camelize(obj)

Convert the key strings in obj to camel-case recursively.

install

With npm do:

npm install penrillian-camelize

To use in the browser, use browserify.

license

MIT

install

npm i penrillian-camelize

Downloadsweekly downloads

4

version

1.0.0

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar