🎨(frontend) use regex literals instead of RegExp constructor

Replace `new RegExp()` constructor calls with regex literal
notation (`/pattern/flags`) following TypeScript best practices.
Improves readability and performance while maintaining
equivalent functionality.
This commit is contained in:
lebaudantoine
2025-06-30 18:13:10 +02:00
committed by aleb_the_flash
parent 4255308010
commit 0d84b1c9ad

View File

@@ -72,9 +72,7 @@ export const routes: Record<
},
recordingDownload: {
name: 'recordingDownload',
path: new RegExp(
`^[/]recording[/](?<recordingId>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$`
),
path: /^\/recording\/(?<recordingId>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,
to: (recordingId: string) => `/recording/${recordingId.trim()}`,
Component: RecordingDownloadRoute,
},