@@ -78,10 +78,10 @@ export class Application extends ChildableComponent<Application, AbstractCompone
7878
7979 @Option ( {
8080 name : 'exclude' ,
81- help : 'Define a pattern for excluded files when specifying paths.' ,
82- type : ParameterType . String
81+ help : 'Define patterns for excluded files when specifying paths.' ,
82+ type : ParameterType . Array
8383 } )
84- exclude : string ;
84+ exclude : Array < string > ;
8585
8686 /**
8787 * The version number of TypeDoc.
@@ -247,9 +247,11 @@ export class Application extends ChildableComponent<Application, AbstractCompone
247247 * @returns The list of input files with expanded directories.
248248 */
249249 public expandInputFiles ( inputFiles ?: string [ ] ) : string [ ] {
250- let exclude : IMinimatch , files : string [ ] = [ ] ;
251- if ( this . exclude ) {
252- exclude = new Minimatch ( this . exclude ) ;
250+ let files : string [ ] = [ ] ;
251+ const exclude : Array < IMinimatch > = this . exclude ? this . exclude . map ( pattern => new Minimatch ( pattern ) ) : [ ] ;
252+
253+ function isExcluded ( fileName : string ) : boolean {
254+ return exclude . some ( mm => mm . match ( fileName ) ) ;
253255 }
254256
255257 function add ( dirname : string ) {
@@ -258,7 +260,7 @@ export class Application extends ChildableComponent<Application, AbstractCompone
258260 if ( FS . statSync ( realpath ) . isDirectory ( ) ) {
259261 add ( realpath ) ;
260262 } else if ( / \. t s x ? $ / . test ( realpath ) ) {
261- if ( exclude && exclude . match ( realpath . replace ( / \\ / g, '/' ) ) ) {
263+ if ( isExcluded ( realpath . replace ( / \\ / g, '/' ) ) ) {
262264 return ;
263265 }
264266
@@ -271,7 +273,7 @@ export class Application extends ChildableComponent<Application, AbstractCompone
271273 file = Path . resolve ( file ) ;
272274 if ( FS . statSync ( file ) . isDirectory ( ) ) {
273275 add ( file ) ;
274- } else if ( ! exclude || ! exclude . match ( file ) ) {
276+ } else if ( ! isExcluded ( file ) ) {
275277 files . push ( file ) ;
276278 }
277279 } ) ;
0 commit comments