Skip to content

Commit

Permalink
fix(utils): improve toCamelCase logic for all capital case
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Oct 31, 2023
1 parent 9e75b4c commit c5fa815
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/utils/src/word-case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,9 @@ export function toCapitalCase<T extends string>(value: T) {
export function toCamelCase(value: string) {
const capitalName = toCapitalCase(value)

if (allCapital(capitalName)) {
return capitalName.toLocaleLowerCase()
}

return capitalName.charAt(0).toLowerCase() + capitalName.slice(1)
}

0 comments on commit c5fa815

Please sign in to comment.