Match array of filters in one go

This commit is contained in:
Henry Painter 2022-08-14 16:59:56 +01:00
parent e6de1860ff
commit 9a3e560c61
2 changed files with 4 additions and 6 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -83,14 +83,12 @@ export class Filter {
private parseFilterItemYaml(item: FilterItemYaml, excludes: excludesFilter = []): FilterRuleItem[] {
var MatchOptions: matchoptions = Object.assign(defaultMatchOptions)
MatchOptions.ignore = excludes
if (typeof item === 'string' || this.isStringsArray(item as string[])) {
return [{status: undefined, isMatch: picomatch(item as string | string[], MatchOptions)}]
}
if (Array.isArray(item)) {
return flat(item.map(i => this.parseFilterItemYaml(i, excludes)))
}
if (typeof item === 'string') {
return [{status: undefined, isMatch: picomatch(item, MatchOptions)}]
}
if (typeof item === 'object') {
var len = Object.keys(item).length
if (len == 2 && item.paths_ignore && item.paths) {