camelize

recursively transform key strings to camel-case

MIT 7 个版本
安装
npm install camelize
yarn add camelize
pnpm add camelize
bun add camelize
README

camelize Version Badge

github actions coverage License Downloads

npm badge

recursively transform key strings to camel-case

example

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

output:

{
  "feeFieFoe": "fum",
  "beepBoop": [
    {
      "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

版本列表
1.0.1 2022-10-12
1.0.0 2014-07-07
0.2.0 2014-07-07
0.1.2 2013-12-18
0.1.1 2013-12-18
0.1.0 2013-07-01
0.0.0 2013-03-23