Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

camelize

ljharb28.6mMIT1.0.1

recursively transform key strings to camel-case

camel-case, json, transform

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.0.1 - 2022-10-11

Commits

  • [eslint] fix indentation 1c978b3
  • [readme] rename, add badges 640a9c9
  • [actions] add reusable workflows 0c27439
  • [eslint] add eslint c2f99b1
  • [meta] add auto-changelog 18083fe
  • [Dev Deps] update tape f11a870
  • [meta] create FUNDING.yml; add funding in package.json 83d0195
  • [meta] use npmignore to autogenerate an npmignore file 34862da
  • Only apps should have lockfiles 270fb10
  • [meta] update URLs fa51c88
  • [meta] add safe-publish-latest f141183
  • [Tests] add aud in posttest 276e8a2

v1.0.0 - 2014-07-07

v0.2.0 - 2014-07-07

Commits

  • add support for dates and regex 5c3ae6c

v0.1.2 - 2013-12-18

Commits

v0.1.1 - 2013-12-18

Commits

  • failing test for camelizing nested strings e4830da
  • do not camelcase nested string values 5adb7c6

v0.1.0 - 2013-06-30

Commits

v0.0.0 - 2013-03-22

Commits