(abs: string, rel: string, isDir: boolean)
| 419 | const visited = new Set<string>(); |
| 420 | |
| 421 | const consider = (abs: string, rel: string, isDir: boolean): void => { |
| 422 | if (isDir) { |
| 423 | if (defaults.ignores(rel + '/')) return; // never node_modules/dist/… via include |
| 424 | // An explicit `exclude` always wins over `include`; prune the whole subtree |
| 425 | // here so a large excluded dir (a committed frontend's own vendored deps, |
| 426 | // build output, …) is never walked — the per-file guard below still catches |
| 427 | // anything a directory pattern doesn't, so this is a pure efficiency win. |
| 428 | if (exclude && exclude.ignores(rel + '/')) return; |
| 429 | walk(abs); |
| 430 | } else { |
| 431 | if (defaults.ignores(rel)) return; |
| 432 | if (!include.ignores(rel)) return; |
| 433 | if (exclude && exclude.ignores(rel)) return; |
| 434 | if (!isSourceFile(rel, overrides)) return; |
| 435 | out.add(rel); |
| 436 | } |
| 437 | }; |
| 438 | |
| 439 | function walk(absDir: string): void { |
| 440 | let realDir: string; |
no test coverage detected