Skip to content

Commit 3e13dc1

Browse files
authored
Merge pull request #2664 from nick-ls/master
2 parents f0de38c + dfb19e6 commit 3e13dc1

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/lib/output/themes/default/DefaultTheme.tsx

+16-2
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,11 @@ export class DefaultTheme extends Theme {
383383
}
384384

385385
if (parent.categories && shouldShowCategories(parent, opts)) {
386-
return filterMap(parent.categories, toNavigation);
386+
return filterMapWithNoneCollection(parent.categories);
387387
}
388388

389389
if (parent.groups && shouldShowGroups(parent, opts)) {
390-
return filterMap(parent.groups, toNavigation);
390+
return filterMapWithNoneCollection(parent.groups);
391391
}
392392

393393
if (opts.includeFolders && parent.childrenIncludingDocuments?.some((child) => child.name.includes("/"))) {
@@ -397,6 +397,20 @@ export class DefaultTheme extends Theme {
397397
return filterMap(parent.childrenIncludingDocuments, toNavigation);
398398
}
399399

400+
function filterMapWithNoneCollection(reflection: ReflectionGroup[] | ReflectionCategory[]) {
401+
const none = reflection.find((x) => x.title.toLocaleLowerCase() === "none");
402+
const others = reflection.filter((x) => x.title.toLocaleLowerCase() !== "none");
403+
404+
const mappedOthers = filterMap(others, toNavigation);
405+
406+
if (none) {
407+
const noneMappedChildren = filterMap(none.children, toNavigation);
408+
return [...noneMappedChildren, ...mappedOthers];
409+
}
410+
411+
return mappedOthers;
412+
}
413+
400414
function deriveModuleFolders(children: Array<DeclarationReflection | DocumentReflection>) {
401415
const result: NavigationElement[] = [];
402416

0 commit comments

Comments
 (0)