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

Weird results when original string consists of all caps #30

Open
alidrus opened this issue May 26, 2023 · 0 comments
Open

Weird results when original string consists of all caps #30

alidrus opened this issue May 26, 2023 · 0 comments

Comments

@alidrus
Copy link

alidrus commented May 26, 2023

I'm trying to make some case conversions for certain types of sensors (e.g. pH sensor, TSS sensor etc).

I haven't covered all the different case types here but I think this is sufficient to indicate there is a fundamental problem with single-letter abbreviated words. For example, in the following code:

import { capitalCase, kebabCase, camelCase, pascalCase } from 'case-anything';

// From Camel Case
console.log(pascalCase('tSS'));
console.log(camelCase('tSS'));
console.log(capitalCase('tSS'));
console.log(kebabCase('tSS'));

// From Pascal Case
console.log(pascalCase('TSS'));
console.log(camelCase('TSS'));
console.log(capitalCase('TSS'));
console.log(kebabCase('TSS'));

Gives the following wrong results:

TSs
tSs
T Ss
t-ss
Tss
tss
Tss
tss

Which is different from the expected result which SHOULD be:

TSS
tSS
T S S
t-s-s
TSS
tSS
T S S
t-s-s

By the way the abbreviation "TSS" used here stands for "Total Suspended Solids". I am using "TSS" to shorten strings.

All that being said, this is a magnificent project and I hope this bug report will help improve it even further. Thanks in advance.

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