(abs: string, rel: string, isDir: boolean)
| 434 | const visited = new Set<string>(); |
| 435 | |
| 436 | const consider = (abs: string, rel: string, isDir: boolean): void => { |
| 437 | if (isDir) { |
| 438 | if (defaults.ignores(rel + '/')) return; // never node_modules/dist/… via include |
| 439 | // An explicit `exclude` always wins over `include`; prune the whole subtree |
| 440 | // here so a large excluded dir (a committed frontend's own vendored deps, |
| 441 | // build output, …) is never walked — the per-file guard below still catches |
| 442 | // anything a directory pattern doesn't, so this is a pure efficiency win. |
| 443 | if (exclude && exclude.ignores(rel + '/')) return; |
| 444 | walk(abs); |
| 445 | } else { |
| 446 | if (defaults.ignores(rel)) return; |
| 447 | if (!include.ignores(rel)) return; |
| 448 | if (exclude && exclude.ignores(rel)) return; |
| 449 | if (!isSourceFile(rel, overrides)) return; |
| 450 | out.add(rel); |
| 451 | } |
| 452 | }; |
| 453 | |
| 454 | function walk(absDir: string): void { |
| 455 | let realDir: string; |
no test coverage detected