Skip to content

Commit

Permalink
removing hyphen for component name mapping (reactplay#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
koustov committed Feb 13, 2023
1 parent 20ece69 commit 40a134e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/services/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ export const toSanitized = (str) => {
if (!str) {
return '';
}
str = str.replace(/-/g, '');
// replace all special characters | symbols with a space
str = str.replace(/[`~!@#$%^&*()_\-+=[\]{};:'"\\|/,.<>?\s]/g, ' ');
// trim spaces at start and end of string
str = str.replace(/^\s+|\s+$/gm, '');

// replace space with dash/hyphen
str = str.replace(/\s+/g, '-');

Expand Down

0 comments on commit 40a134e

Please sign in to comment.