Files
explainegy-nextjs/app/utils.tsx
2023-01-15 17:27:00 +01:00

4 lines
142 B
TypeScript

export function getUrlSafeString(value: string): string {
return encodeURIComponent(value.toLowerCase().replace(/[^a-z0-9 _-]+/gi, "-"));
}