From: Eduardo San Martin Morote Date: Sun, 10 Aug 2025 16:52:05 +0000 (+0200) Subject: chore: outdated comments X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dce4df520959f2a4bf291a6010f68c177a65282d;p=thirdparty%2Fvuejs%2Frouter.git chore: outdated comments --- diff --git a/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.ts b/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.ts index e898ad4d..87f84904 100644 --- a/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.ts +++ b/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.ts @@ -260,6 +260,9 @@ export class MatcherPatternPathCustomParams< // TParams extends MatcherParamsFormatted = ExtractParamTypeFromOptions > implements MatcherPatternPath> { + /** + * Cached keys of the {@link params} object. + */ private paramsKeys: Array constructor( @@ -282,9 +285,9 @@ export class MatcherPatternPathCustomParams< if (!match) { throw miss() } - // NOTE: if we have params, we assume named groups const params = {} as ExtractParamTypeFromOptions for (var i = 0; i < this.paramsKeys.length; i++) { + // var for performance in for loop var paramName = this.paramsKeys[i] var paramOptions = this.params[paramName] var currentMatch = (match[i + 1] as string | undefined) ?? null @@ -293,10 +296,7 @@ export class MatcherPatternPathCustomParams< ? (currentMatch?.split('/') || []).map(decode) : decode(currentMatch) - params[paramName] = (paramOptions.get || identityFn)( - value - // NOTE: paramName and paramOptions are not connected from TS point of view - ) + params[paramName] = (paramOptions.get || identityFn)(value) } if (