-
-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snakeCasedProperties and camelCasedProperties have different behaviours when parsing numbers #336
Comments
@olivierbeaulieu I ran into this same issue. I absolutely love this library, but I really do feel like char->number transitions should add underscore as well. It might be reasonable to not make this assumption, especially with something like { "http2": true } where we would NOT want http2 -> http_2. There is no clear standard on this but the most common approach is "column_1" rather than "column1" if you are doing everything in snake case... Here are some Frankenstein'd types.... That being said this is not nearly as elegant as the type definitions written in this library, so idk. Snake To Camel Case:
Camel To Snake Case
edit: lodash won't 100% match these types. they are close but not all there. |
Would love some more references on how this is dealt with in other projects. That a snake cased That a camel cased
|
@fregante Are we sure its a bug? Would still want some references here that indicates that camel cased |
Feel free to change the label. It looked like a bug report when I fast-triaged 80 issues in the repo 😅 |
Given the following example:
I would expect each operation to be the opposite operation of each other - resulting in F being back to its original value
F = { foo_1: boolean }
.That is not the current behaviour, we as have
F = { foo1: boolean }
.Is that behaviour correct? If so, how can I get back to my original value when jumping from one case to the other?
For context, I'm trying to match the result of lodash's snakeCase
Upvote & Fund
The text was updated successfully, but these errors were encountered: