@@ -22,9 +22,8 @@ import { getDocumentEntryPoints, MinimalSourceFile, Option, readFile } from "../
2222import { convertType } from "./types.js" ;
2323import { ConverterEvents } from "./converter-events.js" ;
2424import { convertSymbol } from "./symbols.js" ;
25- import { createMinimatch , matchesAny , nicePath } from "../utils/paths.js" ;
26- import type { Minimatch } from "minimatch" ;
27- import { hasAllFlags , hasAnyFlag , unique } from "#utils" ;
25+ import { MinimatchSet , nicePath } from "../utils/paths.js" ;
26+ import { type GlobString , hasAllFlags , hasAnyFlag , unique } from "#utils" ;
2827import type { DocumentationEntryPoint } from "../utils/entry-point.js" ;
2928import type { CommentParserConfig } from "./comments/index.js" ;
3029import type { CommentStyle , ValidationOptions } from "../utils/options/declaration.js" ;
@@ -88,9 +87,9 @@ export interface ConverterEvents {
8887export class Converter extends AbstractComponent < Application , ConverterEvents > {
8988 /** @internal */
9089 @Option ( "externalPattern" )
91- accessor externalPattern ! : string [ ] ;
92- private externalPatternCache ?: Minimatch [ ] ;
93- private excludeCache ?: Minimatch [ ] ;
90+ accessor externalPattern ! : GlobString [ ] ;
91+ private externalPatternCache ?: MinimatchSet ;
92+ private excludeCache ?: MinimatchSet ;
9493
9594 /** @internal */
9695 @Option ( "excludeExternals" )
@@ -588,17 +587,17 @@ export class Converter extends AbstractComponent<Application, ConverterEvents> {
588587 }
589588
590589 private isExcluded ( symbol : ts . Symbol ) {
591- this . excludeCache ??= createMinimatch (
590+ this . excludeCache ??= new MinimatchSet (
592591 this . application . options . getValue ( "exclude" ) ,
593592 ) ;
594593 const cache = this . excludeCache ;
595594
596- return ( symbol . getDeclarations ( ) ?? [ ] ) . some ( ( node ) => matchesAny ( cache , node . getSourceFile ( ) . fileName ) ) ;
595+ return ( symbol . getDeclarations ( ) ?? [ ] ) . some ( ( node ) => cache . matchesAny ( node . getSourceFile ( ) . fileName ) ) ;
597596 }
598597
599598 /** @internal */
600599 isExternal ( symbol : ts . Symbol ) {
601- this . externalPatternCache ??= createMinimatch ( this . externalPattern ) ;
600+ this . externalPatternCache ??= new MinimatchSet ( this . externalPattern ) ;
602601 const cache = this . externalPatternCache ;
603602
604603 const declarations = symbol . getDeclarations ( ) ;
@@ -613,7 +612,7 @@ export class Converter extends AbstractComponent<Application, ConverterEvents> {
613612 // If there are any non-external declarations, treat it as non-external
614613 // This is possible with declaration merging against external namespaces
615614 // (e.g. merging with HTMLElementTagNameMap)
616- return declarations . every ( ( node ) => matchesAny ( cache , node . getSourceFile ( ) . fileName ) ) ;
615+ return declarations . every ( ( node ) => cache . matchesAny ( node . getSourceFile ( ) . fileName ) ) ;
617616 }
618617
619618 processDocumentTags ( reflection : Reflection , parent : ContainerReflection ) {
0 commit comments