• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..22-Nov-2021-

LICENSEH A D22-Nov-20211 KiB1915

package.jsonH A D22-Nov-2021951 3938

readme.markdownH A D22-Nov-2021957 6345

readme.markdown

1# camelize
2
3recursively transform key strings to camel-case
4
5[![build status](https://secure.travis-ci.org/substack/camelize.png)](http://travis-ci.org/substack/camelize)
6
7[![browser support](https://ci.testling.com/substack/camelize.png)](http://ci.testling.com/substack/camelize)
8
9# example
10
11``` js
12var camelize = require('camelize');
13var obj = {
14    fee_fie_foe: 'fum',
15    beep_boop: [
16        { 'abc.xyz': 'mno' },
17        { 'foo-bar': 'baz' }
18    ]
19};
20var res = camelize(obj);
21console.log(JSON.stringify(res, null, 2));
22```
23
24output:
25
26```
27{
28  "feeFieFoe": "fum",
29  "beepBoop": [
30    {
31      "abcXyz": "mno"
32    },
33    {
34      "fooBar": "baz"
35    }
36  ]
37}
38```
39
40# methods
41
42``` js
43var camelize = require('camelize')
44```
45
46## camelize(obj)
47
48Convert the key strings in `obj` to camel-case recursively.
49
50# install
51
52With [npm](https://npmjs.org) do:
53
54```
55npm install camelize
56```
57
58To use in the browser, use [browserify](http://browserify.org).
59
60# license
61
62MIT
63