Skip to content

Commit 79e9b52

Browse files
committed
Handle numbers in camel case strings
1 parent 034d2e3 commit 79e9b52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Case.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export enum Case {
1010
}
1111
// Convert a string from snake case to camel case.
1212
const toCamelCase = (str: string): string => {
13-
return str.replace(/_([a-z])/g, match => match[1].toUpperCase());
13+
return str.replace(/_([a-z0-9])/g, match => match[1].toUpperCase());
1414
};
1515

1616
// Convert a string from camel case or pascal case to snake case.

0 commit comments

Comments
 (0)