camelcase-keys
Convert object keys to camelCase using
camelcase
Install
$ npm install --save camelcase-keys
Usage
const camelcaseKeys = ; ;//=> {fooBar: true} const argv = processargv;//=> {_: [], 'foo-bar': true} ;//=> {_: [], fooBar: true} ;//=> {fooBar: {barFoo: true}} ;//=> {fooBar: {bar-foo: true}}
API
camelcaseKeys(input, [options])
input
Type: Object
Object to camelCase.
options
Type: Object
exclude
Type: Array
of (string
|RegExp
)
Default: []
Exclude keys from being camelCased.
recurse
Type: Boolean
Default: false
If true use a recursive algorithm to traverse the entire object graph otherwise only the first level keys are processed.
License
MIT © Sindre Sorhus