Create slugify function

This commit is contained in:
Sat Naing
2022-09-11 14:05:52 +06:30
parent 15a0bd04c3
commit 831999ca17
+7
View File
@@ -0,0 +1,7 @@
const slugify = (str: string) =>
str
.toLowerCase()
.replace(/ /g, "-")
.replace(/[^\w-]+/g, "");
export default slugify;