nbubna/Case

Case.of('123'); results as "lowercase"

giorgio79 opened this issue · 3 comments

Possible solution: detect if submitted string is actually text not numeral.

Quite messy in Javascript as per https://stackoverflow.com/questions/1027224/how-can-i-test-if-a-letter-in-a-string-is-uppercase-or-lowercase-using-javascrip?noredirect=1&lq=1

In this case '123' (a string) will also result lowercase.

Simple parseInt / parseFloat may work, but a regex test would do wonders.

Yeah, i'm not sure what's best here. Part of me thinks this is fine, since '123' doesn't have a case without letters involved (i.e. 'a123' is lower and 'A123' is upper). If anything, the only change that'd make sense to me right now would be to make purely numeric strings return undefined.

Closing, as i don't honestly see this as a problem worth any available fix. Reopen if you have a patch and a good argument.