Skip to content

Convert strings and object keys to camelCase format.

License

Notifications You must be signed in to change notification settings

0xc14m1z/kamelcaser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kamelcaser

Build Status Coverage Status Maintainability

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 }]

About

Convert strings and object keys to camelCase format.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published