[Bug] Fix camel case bug in strings.ts (#6161)

This commit is contained in:
Bertie690 2025-07-27 23:17:46 -04:00 committed by Bertie690
parent 7842bf435f
commit d75836d720

View File

@ -98,7 +98,9 @@ export function toTitleCase(str: string): string {
*/ */
export function toCamelCase(str: string) { export function toCamelCase(str: string) {
return splitWords(str) return splitWords(str)
.map((word, index) => (index === 0 ? word.toLowerCase() : capitalizeFirstLetter(word))) .map((word, index) =>
index === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(),
)
.join(""); .join("");
} }