1.0.0 • Published 9 years ago
camelize-identifier v1.0.0
camelize-identifier
Convert a string into a valid JS identifier
Installing
$ npm install camelize-identifier
API
camelize(name:String)
-> identifier:String
Given a name
, camelize
converts it to a camel cased JavaScript identifier. If name has a leading _
, it will be preserved. If the name
is a reserved word, begins with an illegal leading character (anything but a letter, $
, or _
), contains illegal characters (e.g. !
), camelize
will throw.
For a full set of handled cases, see the tests.
1.0.0
9 years ago