Skip to content

Commit 2bac631

Browse files
committed
Simplify getNamespacePaths
1 parent 111314a commit 2bac631

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/lib/reference.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,11 @@ const getNamespacePaths = (routes: Route[]): string[] => {
8484
return Array.from(
8585
new Set(
8686
routes
87-
.filter(({ isUndocumented }) => !isUndocumented)
88-
.flatMap((route) =>
89-
route.namespace != null && !route.namespace.isUndocumented
90-
? [route.namespace.path]
91-
: [],
92-
),
87+
.filter(
88+
(route) => route.namespace != null && !route.namespace.isUndocumented,
89+
)
90+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
91+
.map((route) => route.namespace!.path),
9392
),
9493
)
9594
}

0 commit comments

Comments
 (0)