(fullPath: string, isDir: boolean, matchers: ScopedIgnore[])
| 1275 | }; |
| 1276 | |
| 1277 | const isIgnored = (fullPath: string, isDir: boolean, matchers: ScopedIgnore[]): boolean => { |
| 1278 | for (const { dir, ig } of matchers) { |
| 1279 | let rel = normalizePath(path.relative(dir, fullPath)); |
| 1280 | if (!rel || rel.startsWith('..')) continue; // not under this matcher's dir |
| 1281 | if (isDir) rel += '/'; // dir-only rules (e.g. `build/`) only match with the slash |
| 1282 | if (ig.ignores(rel)) return true; |
| 1283 | } |
| 1284 | return false; |
| 1285 | }; |
| 1286 | |
| 1287 | function walk(dir: string, matchers: ScopedIgnore[]): void { |
| 1288 | let realDir: string; |
no test coverage detected