(globs: string[])
| 146 | } |
| 147 | |
| 148 | function globListToMatcher(globs: string[]): (file: string) => boolean { |
| 149 | const patterns = globs.map((pattern) => { |
| 150 | if (pattern.startsWith('!')) { |
| 151 | return { |
| 152 | positive: false, |
| 153 | regex: new RegExp('^' + globToRegex(pattern.slice(1)) + '$'), |
| 154 | }; |
| 155 | } else { |
| 156 | return { |
| 157 | positive: true, |
| 158 | regex: new RegExp('^' + globToRegex(pattern) + '$'), |
| 159 | }; |
| 160 | } |
| 161 | }); |
| 162 | return (file: string) => matches(file, patterns); |
| 163 | } |
| 164 | |
| 165 | function matches(file: string, patterns: {positive: boolean; regex: RegExp}[]): boolean { |
| 166 | return patterns.reduce((isMatch, pattern) => { |
no test coverage detected
searching dependent graphs…