diff --git a/dist/index.js b/dist/index.js index 01016be3..600b2085 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5405,6 +5405,11 @@ class Filter { for (const [key, patterns] of Object.entries(this.rules)) { result[key] = files.filter(file => this.isMatch(file, patterns)); } + if (!this.rules.hasOwnProperty('other')) { + const matchingFilenamesList = Object.values(result).flatMap(filteredFiles => filteredFiles.map(file => file.filename)); + const matchingFilenamesSet = new Set(matchingFilenamesList); + result.other = files.filter(file => !matchingFilenamesSet.has(file.filename)); + } return result; } isMatch(file, patterns) { diff --git a/src/filter.ts b/src/filter.ts index 417c24eb..125fb0b4 100644 --- a/src/filter.ts +++ b/src/filter.ts @@ -58,6 +58,13 @@ export class Filter { for (const [key, patterns] of Object.entries(this.rules)) { result[key] = files.filter(file => this.isMatch(file, patterns)) } + + if (!this.rules.hasOwnProperty('other')) { + const matchingFilenamesList = Object.values(result).flatMap(filteredFiles => filteredFiles.map(file => file.filename)) + const matchingFilenamesSet = new Set(matchingFilenamesList) + result.other = files.filter(file => !matchingFilenamesSet.has(file.filename)) + } + return result }