pksunkara / inflect

custom inflections for nodejs
MIT License
229 stars 18 forks source link

Ensure camelize respects first_letter_in_uppercase #2

Closed JedWatson closed 11 years ago

JedWatson commented 11 years ago

I have encountered an inconsistency in the camelize() method.

If it is passed a string with an UppercaseFirstLetter but the second argument first_letter_in_uppercase is passed in as false, result is returned without ensuring the first letter is lower-cased.

Although the main use case appears to be changing underscore_words to camelCase, I am using it to convert paths (e.g. My/Path/To/Something should become myPathToSomething) in which case the first word is not ensured to start with a lowercase letter.

This changeset fixes the issue, and I've added this to the test suite.

Hope you accept the change & update npm soon.

Thanks, Jed.

pksunkara commented 11 years ago

I will push it soon.

JedWatson commented 11 years ago

Thanks!

pksunkara commented 11 years ago

Published v0.3.2