Open sylvain1811 opened 1 year ago
Isn't snake_case supposed to add underscore only if there is any space in the string? I think snake_case conversion of myExampleInput should just give myexampleinput as the output (which is what we are getting in this instance).
I think op interpretation is closer to what a dev would expect. Just as snake case would add underscore for a space, pascal/ camel would remove space and add/ convert to capital letter.
Using that train of thought, converting camel/ pascal to snake should add an underscore in place where the space would've been and demote the capital letter. I mean that would be the entire reason/ intention of why I would send a pascal through a snake converter - vs just sending the pascal through a toLowerCase() function.
Description
TL;DR
Conversion to snake_case should be fixed
myExampleInput
=>myexampleinput
myExampleInput
=>my_example_input
Explanations
Conversion from camelCase or PascalCase to snake case give unexpected results.
For an input written in camelCase or PascalCase, which use an upper case as word separator, the output of snake case conversion value lost separators.
Steps To Reproduce
myExampleInput
Expected behavior
Conversion of the camelCase string
myExampleInput
should give the snake_case stringmy_example_input
.DevToys Version
Version 1.0.10.0 | X64 | RELEASE | b949a18 | b949a18
Relevant Assets/Logs