Skip to content

Commit 18f997e

Browse files
committed
chore: comments docs
1 parent 2787685 commit 18f997e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/router/src/experimental/route-resolver/matchers/matcher-pattern.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ export class MatcherPatternPathDynamic<
200200
? (currentMatch?.split('/') || []).map<string>(decode)
201201
: decode(currentMatch)
202202

203+
// we intentionally pass null and empty arrays to the parser
204+
// so they can better control the outcome
203205
params[paramName] = (parser?.get || identityFn)(value)
204206
}
205207

@@ -239,6 +241,7 @@ export class MatcherPatternPathDynamic<
239241
;[parser, repeatable, optional] = this.params[paramName]
240242
value = (parser?.set || identityFn)(params[paramName])
241243

244+
// non optional repeatable params cannot be empty
242245
if (Array.isArray(value) && !value.length && !optional) {
243246
throw miss()
244247
}

0 commit comments

Comments
 (0)