@@ -383,21 +383,11 @@ export class DefaultTheme extends Theme {
383
383
}
384
384
385
385
if ( parent . categories && shouldShowCategories ( parent , opts ) ) {
386
- const noneCategory = parent . categories . find ( ( x ) => x . title === "none" ) ;
387
- const otherCategories = parent . categories . filter ( ( x ) => x . title !== "none" ) ;
388
-
389
- const mappedOthers = filterMap ( otherCategories , toNavigation ) ;
390
-
391
- if ( noneCategory ) {
392
- const noneMappedChildren = filterMap ( noneCategory . children , toNavigation ) ;
393
- return [ ...noneMappedChildren , ...mappedOthers ] ;
394
- }
395
-
396
- return mappedOthers ;
386
+ return filterMapWithNoneCollection ( parent . categories ) ;
397
387
}
398
388
399
389
if ( parent . groups && shouldShowGroups ( parent , opts ) ) {
400
- return filterMap ( parent . groups , toNavigation ) ;
390
+ return filterMapWithNoneCollection ( parent . groups ) ;
401
391
}
402
392
403
393
if ( opts . includeFolders && parent . childrenIncludingDocuments ?. some ( ( child ) => child . name . includes ( "/" ) ) ) {
@@ -407,6 +397,20 @@ export class DefaultTheme extends Theme {
407
397
return filterMap ( parent . childrenIncludingDocuments , toNavigation ) ;
408
398
}
409
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
+
410
414
function deriveModuleFolders ( children : Array < DeclarationReflection | DocumentReflection > ) {
411
415
const result : NavigationElement [ ] = [ ] ;
412
416
0 commit comments