Skip to content

Commit

Permalink
chore: fixing kebab-case error (#248)
Browse files Browse the repository at this point in the history
* chore: fixing kebab-case error

* Update naming-conventions.js

* chore: fixed eslint error
  • Loading branch information
tiwarishubham635 committed Apr 30, 2024
1 parent c750f95 commit 31b1e31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/naming-conventions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const kebabCase = (input) => {
return input
.trim()
.replace(/[ _]/g, '-') // from snake_case (or spaces)
.replace(/([a-z\d])([A-Z])/g, '$1-$2') // from PascalCase or camelCase
.replace(/([a-z])([A-Z])/g, '$1-$2') // from PascalCase or camelCase
.replace(/(\d[A-Z]*)([A-Z])/g, '$1-$2') // handling numbers followed by letters
.toLowerCase()
.replace(/-+/g, '-') // remove duplicate dashes
Expand Down

0 comments on commit 31b1e31

Please sign in to comment.