recursively transform key strings to camel-case
fork of the original substack/camelize to better operate with the results of minimist & subarg: leaves "_" alone.
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"
}
}
var camelize = require('camelize-minimist')
Convert the key strings in obj
to camel-case recursively.
With npm do:
npm install camelize-minimist
To use in the browser, use browserify.
MIT