Skip to content

recursively transform key strings to camel-case

License

Notifications You must be signed in to change notification settings

forivall/camelize-minimist

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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-minimist')

camelize(obj)

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

install

With npm do:

npm install camelize-minimist

To use in the browser, use browserify.

license

MIT

About

recursively transform key strings to camel-case

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%