Skip to content

Commit fda3524

Browse files
committed
minor stylistic tweak - avoid intermediate values unless needed for comprehension etc
1 parent 6de7e41 commit fda3524

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/kit/src/utils/routing.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ export function exec(match, params, matchers) {
135135
// in the `[[a=b]]/.../[...rest]` case, if one or more optional parameters
136136
// weren't matched, roll the skipped values into the rest
137137
if (param.chained && param.rest && buffered) {
138-
const bufferedValues = values.slice(i - buffered, i + 1);
139-
result[param.name] = bufferedValues.filter((s) => s).join('/');
138+
result[param.name] = values
139+
.slice(i - buffered, i + 1)
140+
.filter((s) => s)
141+
.join('/');
142+
140143
buffered = 0;
141144
continue;
142145
}

0 commit comments

Comments
 (0)