withoutboats / heck

oh heck, a case conversion library
Apache License 2.0
505 stars 34 forks source link

Unexpected casing when using numbers #58

Open Techassi opened 5 months ago

Techassi commented 5 months ago

This seems very related to https://github.com/withoutboats/heck/issues/18.

When converting v1alpha1 to PascalCase, I expect the result to be V1Alpha1, however, V1alpha1 is produced. Adding an API mentioned in https://github.com/withoutboats/heck/issues/18#issuecomment-752538575 could solve this issue by setting number_starts_word: true.

Is there currently any way to produce the expected outcome, or should this be accepted as intended behaviour?

gdnathan commented 4 months ago

I'd like to add something. Whatever the final decision is (to keep lowercase after number or not), I think the option to have the other option would be beneficial. In case of cross language project, it can cause incompatibilities if one camel_case library use one strategy, and an other one use a different one, as seen in this issue