Skip to content

Commit

Permalink
Update var naming in convertCamelToShishKabobCase
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcohen committed Dec 20, 2024
1 parent 2b29f54 commit cd229ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/appUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export const convertToSentenceCase = (str: string) =>
export const convertCamelToShishKabobCase = (str: string) =>
str
// Change capital letters into "-{lowercase letter}"
.replace(/([A-Z])/g, (c, p1, i) => {
.replace(/([A-Z])/g, (capitalLetter, placeholderVar, index) => {
// If capital letter is not first character, precede with '-':
return (i > 0 ? "-" : "") + c.toLowerCase()
return (index > 0 ? "-" : "") + capitalLetter.toLowerCase()
})

0 comments on commit cd229ba

Please sign in to comment.