Skip to content
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

Missing and/or faulty coercion cases #123

Open
reegnz opened this issue Feb 15, 2024 · 1 comment
Open

Missing and/or faulty coercion cases #123

reegnz opened this issue Feb 15, 2024 · 1 comment

Comments

@reegnz
Copy link

reegnz commented Feb 15, 2024

When using coercion I've run onto an edge-case on dot.case not properly converted back to camelCase. I decided to dig deeper, and found a few more, so here's a result of faulty behaviours with I managed to find:

input:

snake_case
kebab-case
camelCase
PascalCase
dot.case
UPPER_CASE
space case

Converting to snake_case (1 fault):

snake_case
kebab_case
camel_case
pascal_case
dot_case
upper_case
space case # not converted to snake_case

Converting to kebab-case (1 fault):

snake-case
kebab-case
camel-case
pascal-case
dot-case
upper-case
space case # not converted to kebab-case

Converting to camelCase (4 faults):

snakeCase
kebabCase
camelcase # messed up output, losing all casing information
pascalcase # messed up output, losing all casing information
dot.case # not converted to camelCase
upperCase
space case # not converted to camelCase

Converting to PascalCase (6 faults):

SnakeCase
kebabCase # converted to camelCase instead
camelcase # messed up output, losing all casing information
pascalcase # messed up output, losing all casing information
dot.case # not converted to PascalCase
upperCase # converted to camelCase instead
space case # not converted to PascalCase

Connverting to UPPER_CASE (1 fault):

SNAKE_CASE
KEBAB_CASE
CAMEL_CASE
PASCAL_CASE
DOT_CASE
UPPER_CASE
SPACE CASE # only partial conversion, failed to add _

Converting to dot.case (1 fault):

snake.case
kebab.case
camel.case
pascal.case
dot.case
upper.case
space case # not converted to dot.case

Converting to space case (no faults):

snake case
kebab case
camel case
pascal case
dot case
upper case
space case
@reegnz reegnz changed the title Missing coercion transformation paths Missing and/or faulty coercion Feb 15, 2024
@reegnz
Copy link
Author

reegnz commented Feb 15, 2024

I think the space case issues have a single root cause which is that there is no code path converting space case to snake case.

@reegnz reegnz changed the title Missing and/or faulty coercion Missing and/or faulty coercion cases Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant