diff options
-rw-r--r-- | packages/astro/src/core/routing/params.ts | 4 | ||||
-rw-r--r-- | packages/astro/test/units/routing/route-sanitization.test.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/packages/astro/src/core/routing/params.ts b/packages/astro/src/core/routing/params.ts index d2856563e..1e6b16858 100644 --- a/packages/astro/src/core/routing/params.ts +++ b/packages/astro/src/core/routing/params.ts @@ -1,6 +1,6 @@ import type { GetStaticPathsItem, Params, RouteData } from '../../@types/astro'; -import { validateGetStaticPathsParameter } from './validation.js'; import { trimSlashes } from '../path.js'; +import { validateGetStaticPathsParameter } from './validation.js'; /** * given an array of params like `['x', 'y', 'z']` for @@ -34,7 +34,7 @@ export function stringifyParams(params: GetStaticPathsItem['params'], route: Rou validateGetStaticPathsParameter(next, route.component); const [key, value] = next; if (value !== undefined) { - acc[key] = typeof value === 'string' ? trimSlashes(value) : value.toString() + acc[key] = typeof value === 'string' ? trimSlashes(value) : value.toString(); } return acc; }, {} as Params); diff --git a/packages/astro/test/units/routing/route-sanitization.test.js b/packages/astro/test/units/routing/route-sanitization.test.js index 3bddeb92a..14c9c3829 100644 --- a/packages/astro/test/units/routing/route-sanitization.test.js +++ b/packages/astro/test/units/routing/route-sanitization.test.js @@ -12,7 +12,7 @@ import testAdapter from '../../test-adapter.js'; const root = new URL('../../fixtures/alias/', import.meta.url); const fileSystem = { -'/src/pages/[...testSlashTrim].astro': ` + '/src/pages/[...testSlashTrim].astro': ` --- export function getStaticPaths() { return [ |