Skip to content

Commit 4aa856d

Browse files
committed
cleanup fn
1 parent e7d5a96 commit 4aa856d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/lib/store-helpers/find-pathnames-in-router.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,12 @@ const recurse = (
3131
}
3232
}
3333
} else if (matchAny) {
34-
for (const [lastPart, child] of node.children.entries()) {
35-
pathnames.push(
36-
...recurse(child, parts.slice(1), [...walked, lastPart])
37-
);
34+
for (const [part, child] of node.children.entries()) {
35+
pathnames.push(...recurse(child, parts.slice(1), [...walked, part]));
3836
}
3937
} else if (node.children.has(part)) {
4038
const child = node.children.get(part)!;
41-
if (child) {
42-
pathnames.push(...recurse(child, parts.slice(1), [...walked, part]));
43-
}
39+
pathnames.push(...recurse(child, parts.slice(1), [...walked, part]));
4440
}
4541

4642
return pathnames;

0 commit comments

Comments
 (0)