From: Eduardo San Martin Morote Date: Fri, 29 Aug 2025 13:06:57 +0000 (+0200) Subject: chore: comments docs X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18f997e7c3e6c91fcb96a2b21ea06ebda057a123;p=thirdparty%2Fvuejs%2Frouter.git chore: comments docs --- 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 cf7c0cf3..10d7bf93 100644 --- a/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.ts +++ b/packages/router/src/experimental/route-resolver/matchers/matcher-pattern.ts @@ -200,6 +200,8 @@ export class MatcherPatternPathDynamic< ? (currentMatch?.split('/') || []).map(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() }