Skip to content

Commit

Permalink
fix(isUppercase): assume characters lowercase by default (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Jan 10, 2024
1 parent d2c281f commit 57cfd15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function isUppercase(char = ""): boolean | undefined {
if (NUMBER_CHAR_RE.test(char)) {
return undefined;
}
return char.toUpperCase() === char;
return char !== char.toLowerCase();
}

export function splitByCase<T extends string>(str: T): SplitByCase<T>;
Expand Down
1 change: 1 addition & 0 deletions test/scule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe("splitByCase", () => {
["foo", "Bar", "fuzz", "FI", "Zz"],
["\\", ".", "-"],
],
["new-name-value", ["new-name-value"], ["_"]],
])("%s => %s", (input, expected, customSplitters?) => {
if (customSplitters) {
expect(splitByCase(input, customSplitters)).toMatchObject(expected);
Expand Down

0 comments on commit 57cfd15

Please sign in to comment.