/** * Shared compiled-pattern cache (C2): `matchesAnyPattern` in `package-manager.ts` and * `matchesResourceProfilePattern` in `settings-manager.ts` each test up to 6 candidate strings * (relative path, basename, absolute path, and the same 3 for the parent directory) against every * configured glob pattern, per file, on every reload/profile switch. The functional `minimatch(p, * pattern, options)` re-parses `pattern` into a `Minimatch` instance on EVERY call — so the same * pattern was being compiled up to 6x per file per call site. * * `new Minimatch(pattern, options).match(p)` is exactly what the functional form does internally * (see `minimatch`'s own implementation: `assertValidPattern(pattern)` then * `new Minimatch(pattern, options).match(p)`, with comment/empty-pattern short-circuits handled * inside the class itself), so precompiling and reusing the `Minimatch` instance is behaviorally * identical to calling the functional form each time — only the redundant re-parsing is removed. * * Both call sites invoke `minimatch(candidate, pattern)` with NO options argument (always the * library default `{}`), so the cache key is the pattern string alone. If a future caller needs * non-default options, extend the key to include a serialized options object rather than reusing * this cache blind — a `Minimatch` compiled under different options is not interchangeable. * * The cache is a plain, unbounded module-level `Map`. That is safe here because patterns are not * arbitrary/untrusted input: they come from a small, operator-controlled set (package resource * patterns in settings, `.gitignore`-style profile overrides) that is bounded by how much a human * hand-authors into settings/profile files, not by file count or request volume. It never grows * per-file or per-scan. */ import { type MinimatchOptions } from "minimatch"; /** * Drop-in replacement for `minimatch(candidate, pattern, options)` that compiles each unique * `(pattern, options)` pair once and reuses it. Match results are identical to the functional * form; only the redundant glob-compilation work is eliminated. */ export declare function matchesCompiledPattern(candidate: string, pattern: string, options?: MinimatchOptions): boolean; //# sourceMappingURL=minimatch-cache.d.ts.map