kamelcaser
v1.0.5
Published
Convert strings and object keys to camelCase format.
Downloads
9
Readme
kamelcaser
Convert strings and object keys to camelCase format.
how to install
$ npm install --save kamelcaser
how to use it
import KamelCaser from "kamelcaser"
// or var KamelCaser = require("kamelcaser")
KamelCaser.string("dashed-string")
// dashedString
KamelCaser.string("snake_string")
// snakeString
KamelCaser.string("PascalString")
// pascalString
KamelCaser.keys({ first_key: 42, SecondKey: 43, "third-key": 44 })
// { firstKey: 42, secondKey: 43, thirdKey: 44 }
// object with deep keys
KamelCaser.keys({ first_key: 42, SecondKey: 43, "third-key": 44, fourthKey: { "fifth_key": 45 } })
// { firstKey: 42, secondKey: 43, thirdKey: 44, fourthKey: { fifthKey: 45 } }
// array of objects
KamelCaser.keys([{ first_key: 42 }, { SecondKey: 43 }, { "third-key": 44 }])
// [{ firstKey: 42 }, { secondKey: 43 }, { thirdKey: 44 }]