mirror of
https://github.com/dorny/paths-filter.git
synced 2025-06-08 00:59:04 +00:00
Match array of filters in one go
This commit is contained in:
parent
e6de1860ff
commit
9a3e560c61
2 changed files with 4 additions and 6 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue