From 0d84b1c9ad7f9307ebc35d2e7fc76bf651663e52 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Mon, 30 Jun 2025 18:13:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8(frontend)=20use=20regex=20literals?= =?UTF-8?q?=20instead=20of=20RegExp=20constructor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace `new RegExp()` constructor calls with regex literal notation (`/pattern/flags`) following TypeScript best practices. Improves readability and performance while maintaining equivalent functionality. --- src/frontend/src/routes.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/frontend/src/routes.ts b/src/frontend/src/routes.ts index c9599deb..ed2ff1ac 100644 --- a/src/frontend/src/routes.ts +++ b/src/frontend/src/routes.ts @@ -72,9 +72,7 @@ export const routes: Record< }, recordingDownload: { name: 'recordingDownload', - path: new RegExp( - `^[/]recording[/](?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$` - ), + path: /^\/recording\/(?[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, },