yeah
This commit is contained in:
9
server/utils/slugify.ts
Normal file
9
server/utils/slugify.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export function slugify(str: string): string {
|
||||
return str
|
||||
.toLowerCase()
|
||||
.normalize('NFD')
|
||||
.replace(/[\u0300-\u036f]/g, '')
|
||||
.replace(/[^a-z0-9]+/g, '-')
|
||||
.replace(/^-+/, '')
|
||||
.replace(/-+$/, '')
|
||||
}
|
||||
Reference in New Issue
Block a user