(dir: string)
| 1265 | } |
| 1266 | |
| 1267 | const loadIgnore = (dir: string): ScopedIgnore | null => { |
| 1268 | const giPath = path.join(dir, '.gitignore'); |
| 1269 | if (!fs.existsSync(giPath)) return null; |
| 1270 | // readGitignorePatterns is defensive: a non-UTF-8 (DLP-encrypted) or |
| 1271 | // uncompilable .gitignore is skipped/filtered with a warning, never thrown |
| 1272 | // (issue #682) — so the per-file `.ignores()` calls below can't crash. |
| 1273 | const patterns = readGitignorePatterns(giPath); |
| 1274 | return patterns ? { dir, ig: ignore().add(patterns) } : null; |
| 1275 | }; |
| 1276 | |
| 1277 | const isIgnored = (fullPath: string, isDir: boolean, matchers: ScopedIgnore[]): boolean => { |
| 1278 | for (const { dir, ig } of matchers) { |
no test coverage detected