Tazinho / snakecase

🐍🐍🐍 A systematic approach to parse strings and automate the conversion to snake_case, UpperCamelCase or any other case.
https://tazinho.github.io/snakecase/
GNU General Public License v3.0
146 stars 8 forks source link

Feature request: Support "kebab-case" #197

Open IndrajeetPatil opened 9 months ago

IndrajeetPatil commented 9 months ago

I have seen this case used often in naming conventions for file names (e.g. test-one-sample-test.R), in addition to naming variables.

Will it be possible for {snakecase} to support this?

Tazinho commented 9 months ago

Hi @IndrajeetPatil you could use case = β€žsnakeβ€œ and sep_out = β€ž-β€œ.

IndrajeetPatil commented 9 months ago

Thanks for the quick response!

From discoverability perspective, I still think it might be worth it to support case = "kebab", but I will leave that up to you πŸ™ƒ

Tazinho commented 9 months ago

I think itβ€˜s a good point you are making. Will do once I come back here.

JosiahParry commented 5 months ago

Coming here to request the same thing. I needed to convert from lower camel to lower-kebab-case. I was surprised that this was not possible out of the box. I used to_any_case(x, sep_out = "-") which worked just fine. But snakecase is all about being easy to use!

I was surprised that there is not feature parity with heck rust library