-
-
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
Feature Request: CamelCase to behave like lodash.camelCase and camelcase #224
Comments
I agree with you. It's how I prefer doing camel-case. But there are definitely some people that prefer the existing behavior... For example, the @wwwzbwcom Thoughts on this? |
Maybe add a option to toggle it? |
Right, as
It does not split on uppercase characters in any way, unlike the Though the Currently To support this use case I think we essentially would have to merge the functionality of the two. I can't remember why I didn't do that initially. |
There is one major difference between the current implementation in type-fest/test-d/camel-case.ts Lines 9 to 10 in e5732ab
One could argue that this should be dropped because one can just as well use the TS Also, as a reference, And support for conversion from screaming kebab/snake/space cases was added in: #234 |
Right now,
CamelCase
(and, obviously,CamelCasedProperties
andCamelCasedPropertiesDeep
) behaves weirdly when handling two character strings.When it's a 2 character string (like
ID
, for example), it will transform the string as expected (ID
toid
), but strings likeHostIDPlayer
will leave theID
part untouched (HostIDPlayer
tohostIDPlayer
).Libraries like
lodash.camelCase
andcamelcase
will transform the strings as expected as can be seen in this codesandbox.I can't say I know enough about TS' type system, but is there a way to make
CamelCase
behave likelodash.camelCase
andcamelcase
? That was, to me, what I expected the behavior to be.Upvote & Fund
The text was updated successfully, but these errors were encountered: