camelize-minimist

1.0.0 • Public • Published

camelize-minimist

recursively transform key strings to camel-case

fork of the original substack/camelize to better operate with the results of minimist & subarg: leaves "_" alone.

build status

example

var camelize = require('camelize-minimist');
var obj = {
    'fee-fie-foe': 'fum',
    beep_boop: {
        _: ["zip-zap"],
        'abc.xyz': 'mno',
        'foo_bar': 'baz'
    }
};
var res = camelize(obj);
console.log(JSON.stringify(res, null, 2));

output:

{
  "feeFieFoe": "fum",
  "beepBoop": {
    "_": [
      "zip-zap"
    ],
    "abcXyz": "mno",
    "fooBar": "baz"
  }
}

methods

var camelize = require('camelize')

camelize(obj)

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

install

With npm do:

npm install camelize

To use in the browser, use browserify.

license

MIT

Package Sidebar

Install

npm i camelize-minimist

Weekly Downloads

13

Version

1.0.0

License

MIT

Last publish

Collaborators

  • forivall