feat(db): backfill slugs for existing non-Steam games

This commit is contained in:
2026-05-20 02:19:42 +08:00
parent b835ac678f
commit 61d516f1b1
2 changed files with 59 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
export function generateSlug(title: string): string {
return title
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/-+/g, "-")
.replace(/^-|-$/g, "")
.slice(0, 80)
.replace(/-$/g, "")
}