File tree 1 file changed +16
-2
lines changed
src/lib/output/themes/default
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -383,11 +383,11 @@ export class DefaultTheme extends Theme {
383
383
}
384
384
385
385
if ( parent . categories && shouldShowCategories ( parent , opts ) ) {
386
- return filterMap ( parent . categories , toNavigation ) ;
386
+ return filterMapWithNoneCollection ( parent . categories ) ;
387
387
}
388
388
389
389
if ( parent . groups && shouldShowGroups ( parent , opts ) ) {
390
- return filterMap ( parent . groups , toNavigation ) ;
390
+ return filterMapWithNoneCollection ( parent . groups ) ;
391
391
}
392
392
393
393
if ( opts . includeFolders && parent . childrenIncludingDocuments ?. some ( ( child ) => child . name . includes ( "/" ) ) ) {
@@ -397,6 +397,20 @@ export class DefaultTheme extends Theme {
397
397
return filterMap ( parent . childrenIncludingDocuments , toNavigation ) ;
398
398
}
399
399
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
+
400
414
function deriveModuleFolders ( children : Array < DeclarationReflection | DocumentReflection > ) {
401
415
const result : NavigationElement [ ] = [ ] ;
402
416
You can’t perform that action at this time.
0 commit comments