🎨(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:
committed by
aleb_the_flash
parent
4255308010
commit
0d84b1c9ad
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user