Skip to content

Commit

Permalink
refactor: use one regex istead of 3
Browse files Browse the repository at this point in the history
Co-authored-by: François Parmentier <[email protected]>
  • Loading branch information
AlasDiablo and parmentf authored Jul 12, 2024
1 parent d133caf commit 337bb2a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/app/js/root-admin/CreateTenantDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ const cleanUpName = (name) => {
// https://stackoverflow.com/questions/36557202/replacing-special-characters-with-dashes

return deburr(name)
.replace(/\s+/g, '-')
.replace(/_/g, '-')
.replace(/\W+/g, '-')
.replace(/[\s_\W]+/g, '-')
.replace(/^-/, '')
.substring(0, getTenantMaxSize(window.__DBNAME__))
.toLowerCase();
Expand Down

0 comments on commit 337bb2a

Please sign in to comment.