@@ -503,37 +503,37 @@ export class DefaultTheme extends Theme {
503503}
504504
505505function getReflectionClasses ( reflection : Reflection , filters : Record < string , boolean > ) {
506- const classes : string [ ] = [ ] ;
506+ const classes = new Set < string > ( ) ;
507507
508508 // Filter classes should match up with the settings function in
509509 // partials/navigation.tsx.
510510 for ( const key of Object . keys ( filters ) ) {
511511 if ( key === "inherited" ) {
512512 if ( reflection . flags . isInherited ) {
513- classes . push ( "tsd-is-inherited" ) ;
513+ classes . add ( "tsd-is-inherited" ) ;
514514 }
515515 } else if ( key === "protected" ) {
516516 if ( reflection . flags . isProtected ) {
517- classes . push ( "tsd-is-protected" ) ;
517+ classes . add ( "tsd-is-protected" ) ;
518518 }
519519 } else if ( key === "private" ) {
520520 if ( reflection . flags . isPrivate ) {
521- classes . push ( "tsd-is-private" ) ;
521+ classes . add ( "tsd-is-private" ) ;
522522 }
523523 } else if ( key === "external" ) {
524524 if ( reflection . flags . isExternal ) {
525- classes . push ( "tsd-is-external" ) ;
525+ classes . add ( "tsd-is-external" ) ;
526526 }
527527 } else if ( key . startsWith ( "@" ) ) {
528528 if ( key === "@deprecated" ) {
529529 if ( reflection . isDeprecated ( ) ) {
530- classes . push ( toStyleClass ( `tsd-is-${ key . substring ( 1 ) } ` ) ) ;
530+ classes . add ( toStyleClass ( `tsd-is-${ key . substring ( 1 ) } ` ) ) ;
531531 }
532532 } else if (
533533 reflection . comment ?. hasModifier ( key as `@${string } `) ||
534534 reflection . comment ?. getTag ( key as `@${string } `)
535535 ) {
536- classes . push ( toStyleClass ( `tsd-is-${ key . substring ( 1 ) } ` ) ) ;
536+ classes . add ( toStyleClass ( `tsd-is-${ key . substring ( 1 ) } ` ) ) ;
537537 } else if ( reflection . isDeclaration ( ) ) {
538538 const ownSignatures = reflection . getNonIndexSignatures ( ) ;
539539 // Check methods and accessors, find common tags, elevate
@@ -544,13 +544,13 @@ function getReflectionClasses(reflection: Reflection, filters: Record<string, bo
544544 refl . comment ?. hasModifier ( key as `@${string } `) || refl . comment ?. getTag ( key as `@${string } `) ,
545545 )
546546 ) {
547- classes . push ( toStyleClass ( `tsd-is-${ key . substring ( 1 ) } ` ) ) ;
547+ classes . add ( toStyleClass ( `tsd-is-${ key . substring ( 1 ) } ` ) ) ;
548548 }
549549 }
550550 }
551551 }
552552
553- return classes . join ( " " ) ;
553+ return Array . from ( classes ) . join ( " " ) ;
554554}
555555
556556function shouldShowCategories ( reflection : Reflection , opts : { includeCategories : boolean ; includeGroups : boolean } ) {
0 commit comments