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.
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 asfalse
, 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 becomemyPathToSomething
) 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.