fix: replace non valid chars with space
This commit is contained in:
+2
-2
@@ -21,10 +21,10 @@ export class DomainFactory {
|
||||
.map((word) => {
|
||||
word = word
|
||||
.normalize("NFD")
|
||||
.replace(/[\u0300-\u036f]/g, "")
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9-]/g, "")
|
||||
.trim();
|
||||
if (word.includes(" ") || word.length == 0) {
|
||||
if (word.length == 0) {
|
||||
return null;
|
||||
}
|
||||
return word;
|
||||
|
||||
Reference in New Issue
Block a user