portfolio/lib/createSlug.ts

3 lines
100 B
TypeScript

export function createSlug(title: string) {
return title.toLowerCase().replace(/[.\s]+/g, '-')
}