adding a clean string function
This commit is contained in:
parent
7f8848b839
commit
b9e70b70c7
|
|
@ -24,3 +24,12 @@ export function getThematiqueFamilySlug(thematique_slug) {
|
||||||
return "location";
|
return "location";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function cleanString(string) {
|
||||||
|
return string
|
||||||
|
.normalize("NFD")
|
||||||
|
.replace(/[\u0300-\u036f]/g, "")
|
||||||
|
.toLowerCase()
|
||||||
|
.split(" ")
|
||||||
|
.join("-");
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user