Skip to content

Commit

Permalink
fix: Replace non-standard and deprecated call to String.substr() with…
Browse files Browse the repository at this point in the history
… String.slice()
  • Loading branch information
lucasnetau committed Oct 6, 2023
1 parent a7ffe61 commit 813cecf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ export function titleCase(str) {
const regex = new RegExp(`(?!${lowers.join('|')})\\w\\S*`, 'g')
return `${str}`.replace(
regex,
txt => txt.charAt(0).toUpperCase() + txt.substr(1).replace(/[A-Z]/g, word => ` ${word}`),
txt => txt.charAt(0).toUpperCase() + txt.slice(1).replace(/[A-Z]/g, word => ` ${word}`),
)
}

Expand Down

0 comments on commit 813cecf

Please sign in to comment.