From 84e5e91cee6c20e6770ad1710a6f0abd71b2fddc Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Mon, 21 Sep 2026 23:03:36 +0000 Subject: [PATCH] fix(docs): Allow bracket notation in repo paths --- src/utils/repo-path.ts | 2 +- tests/repo-path.test.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils/repo-path.ts b/src/utils/repo-path.ts index 22330d275..f7b790c6c 100644 --- a/src/utils/repo-path.ts +++ b/src/utils/repo-path.ts @@ -1,6 +1,6 @@ export const MAX_REPO_PATH_LENGTH = 512 -const REPO_PATH_SEGMENT_PATTERN = /^[a-zA-Z0-9._$+-]+$/ +const REPO_PATH_SEGMENT_PATTERN = /^[a-zA-Z0-9._$+\[\]-]+$/ export function isValidRepoPath(path: string) { if (path === '') { diff --git a/tests/repo-path.test.ts b/tests/repo-path.test.ts index 7c2a78c65..9c616368f 100644 --- a/tests/repo-path.test.ts +++ b/tests/repo-path.test.ts @@ -16,6 +16,12 @@ assert.equal( 'underscores remain valid repo path segments', ) +assert.equal( + isValidRepoPath('examples/svelte/ssr/src/routes/[postId]/+page.ts'), + true, + 'Svelte bracket-notation route params are valid repo path segments', +) + assert.equal( isValidRepoPath('../src/routes/__root.tsx'), false,