Skip to content

Commit

Permalink
perf(lib/tocamelcase): immediately return instead of using temp var (#…
Browse files Browse the repository at this point in the history
…243)

Signed-off-by: Frazer Smith <frazer.dev@outlook.com>
  • Loading branch information
Fdawgs authored Jul 20, 2024
1 parent f746d13 commit 50cfea0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/toCamelCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ module.exports = function toCamelCase (name) {
if (name[0] === '@') {
name = name.slice(1).replace('/', '-')
}
const newName = name.replace(/-(.)/g, function (match, g1) {
return name.replace(/-(.)/g, function (match, g1) {
return g1.toUpperCase()
})
return newName
}

0 comments on commit 50cfea0

Please sign in to comment.