blakeembrey / change-case

Convert strings between camelCase, PascalCase, Capital Case, snake_case and more
MIT License
2.22k stars 92 forks source link

Convert string to lowercase prior to processing #288

Closed PythonCoderAS closed 2 years ago

PythonCoderAS commented 2 years ago

There were no statements written that stated that only lowercase inputs were accepted, and I had to find out the hard way. I think it would be nice if the library could automatically do the lowercase conversion or at least note it in the documentation so that developers know to pre-lowercase their strings.

blakeembrey commented 2 years ago

It does convert before processing. Maybe you can provide an example of your problem so it can be reviewed?

PythonCoderAS commented 2 years ago

Here is an example:

> console.log(titleCase("PRIMARY"))
PRIMARY
> console.log(titleCase("PRIMARY".toLowerCase()))
Primary
blakeembrey commented 2 years ago

I see. Title case is different to the rest of the functionality because it isn’t part of the case changing. It’s not a requirement for it to be lower-case, but it’s not changing that because it’s possible you’re using a valid acronym (e.g. UUID).