diff --git a/packages/router/src/index.ts b/packages/router/src/index.ts index d8b4d56..a91bc23 100644 --- a/packages/router/src/index.ts +++ b/packages/router/src/index.ts @@ -638,8 +638,10 @@ function matchesSegment(expected: string | undefined, segment: string): boolean return expected === undefined ? segment !== '' : segment === expected } +// `params` is spread only for a param named `__proto__`, not on every pass. +/* oxlint-disable oxc/no-accumulating-spread */ function toParams(route: Route, segments: readonly string[]): Record { - const params: Record = {} + let params: Record = {} const end = segments.length - route.tail for (const { name, index, catchAll } of route.params!) { @@ -652,14 +654,10 @@ function toParams(route: Route, segments: readonly string[]): Record(route: Route, segments: readonly string[]): Record