Skip to content

Commit dce4df5

Browse files
committed
chore: outdated comments
1 parent 18ccc00 commit dce4df5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ export class MatcherPatternPathCustomParams<
260260
// TParams extends MatcherParamsFormatted = ExtractParamTypeFromOptions<TParamsOptions>
261261
> implements MatcherPatternPath<ExtractParamTypeFromOptions<TParamsOptions>>
262262
{
263+
/**
264+
* Cached keys of the {@link params} object.
265+
*/
263266
private paramsKeys: Array<keyof TParamsOptions>
264267

265268
constructor(
@@ -282,9 +285,9 @@ export class MatcherPatternPathCustomParams<
282285
if (!match) {
283286
throw miss()
284287
}
285-
// NOTE: if we have params, we assume named groups
286288
const params = {} as ExtractParamTypeFromOptions<TParamsOptions>
287289
for (var i = 0; i < this.paramsKeys.length; i++) {
290+
// var for performance in for loop
288291
var paramName = this.paramsKeys[i]
289292
var paramOptions = this.params[paramName]
290293
var currentMatch = (match[i + 1] as string | undefined) ?? null
@@ -293,10 +296,7 @@ export class MatcherPatternPathCustomParams<
293296
? (currentMatch?.split('/') || []).map<string>(decode)
294297
: decode(currentMatch)
295298

296-
params[paramName] = (paramOptions.get || identityFn)(
297-
value
298-
// NOTE: paramName and paramOptions are not connected from TS point of view
299-
)
299+
params[paramName] = (paramOptions.get || identityFn)(value)
300300
}
301301

302302
if (

0 commit comments

Comments
 (0)