]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
chore: comments docs
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 29 Aug 2025 13:06:57 +0000 (15:06 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 29 Aug 2025 13:06:57 +0000 (15:06 +0200)
packages/router/src/experimental/route-resolver/matchers/matcher-pattern.ts

index cf7c0cf30699b4988e074bbad007cc2d8136e829..10d7bf93a65e727eb5658ff452a24c8e879fe2ec 100644 (file)
@@ -200,6 +200,8 @@ export class MatcherPatternPathDynamic<
         ? (currentMatch?.split('/') || []).map<string>(decode)
         : decode(currentMatch)
 
+      // we intentionally pass null and empty arrays to the parser
+      // so they can better control the outcome
       params[paramName] = (parser?.get || identityFn)(value)
     }
 
@@ -239,6 +241,7 @@ export class MatcherPatternPathDynamic<
             ;[parser, repeatable, optional] = this.params[paramName]
             value = (parser?.set || identityFn)(params[paramName])
 
+            // non optional repeatable params cannot be empty
             if (Array.isArray(value) && !value.length && !optional) {
               throw miss()
             }