]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: outdated comments
authorEduardo San Martin Morote <posva13@gmail.com>
Sun, 10 Aug 2025 16:52:05 +0000 (18:52 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Sun, 10 Aug 2025 16:52:05 +0000 (18:52 +0200)
packages/router/src/experimental/route-resolver/matchers/matcher-pattern.ts

index e898ad4d64d019b204eaf05a07d63489fe12f567..87f84904b54b0e0d0dde74404ed5411715cb633c 100644 (file)
@@ -260,6 +260,9 @@ export class MatcherPatternPathCustomParams<
   // TParams extends MatcherParamsFormatted = ExtractParamTypeFromOptions<TParamsOptions>
 > implements MatcherPatternPath<ExtractParamTypeFromOptions<TParamsOptions>>
 {
+  /**
+   * Cached keys of the {@link params} object.
+   */
   private paramsKeys: Array<keyof TParamsOptions>
 
   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<TParamsOptions>
     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<string>(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 (