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