-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
Behavior of PascalCase
#198
Comments
Or rather, if it somehow could be configurable (as is the case with |
I think One of the most popular camelcase/pascalcase packages on npm also has this behavior: https://github.com/sindresorhus/camelcase/blob/a83fd06fc15538d92deacbdfdcb397d9dbec68ed/test.js#L81 |
Two-way conversion is a non-goal. |
I hear you. Thank you for givning your view on the matter. |
I'm using
pascal-case
(as part ofchange-case
) which seems to take a slightly different specification route thantype-fest
'sPascalCase
type. As a result, they don't play well together.The difference comes down to how numbers are treated.
pascal-case
prefixes delimited numbers with_
.PascalCase
simply merges it with the preceding word.Examples
pascalCase("foo-1") // "Foo_1"
vs.PascalCase<"foo-1"> // "foo1
Personally, I prefer
pascal-case
's take on this one, but I would like to hear if there has been any explicit reasoning around the current behavior or if it just hasn't been thought of.The main reason is being to able to convert to and fro two casings:
paramCase(pascalCase("foo-1")) // "foo-1"
Which just isn't possible with
PascalCase
:KebabCase<PascalCase<"foo-1">> // "foo1"
The text was updated successfully, but these errors were encountered: