(abs: string, rel: string, isDir: boolean)
| 801 | const visited = new Set<string>(); |
| 802 | |
| 803 | const consider = (abs: string, rel: string, isDir: boolean): void => { |
| 804 | if (isDir) { |
| 805 | if (defaults.ignores(rel + '/')) return; // never node_modules/dist/… via include |
| 806 | // An explicit `exclude` always wins over `include`; prune the whole subtree |
| 807 | // here so a large excluded dir (a committed frontend's own vendored deps, |
| 808 | // build output, …) is never walked — the per-file guard below still catches |
| 809 | // anything a directory pattern doesn't, so this is a pure efficiency win. |
| 810 | if (exclude && exclude.ignores(rel + '/')) return; |
| 811 | walk(abs); |
| 812 | } else { |
| 813 | if (defaults.ignores(rel)) return; |
| 814 | if (!include.ignores(rel)) return; |
| 815 | if (exclude && exclude.ignores(rel)) return; |
| 816 | if (!isSourceFile(rel, overrides, rootDir)) return; |
| 817 | out.add(rel); |
| 818 | } |
| 819 | }; |
| 820 | |
| 821 | function walk(absDir: string): void { |
| 822 | let realDir: string; |
no test coverage detected