Tighten PR Prep and Test after their first runs

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-04 10:24:07 -08:00
1 parent ff1c793633
commit bf23d7eeea
22 files changed
+261 -109

No files matched your search

+7 -2
View File
@@ -102,8 +102,13 @@ export function globToRegExp(glob) {
return new RegExp(`^${out}$`);
}
// Compiled globs, by glob text (null for an unsupported one): a map's few
// globs are tested against every file in a run.
const compiled = new Map();
/** Does the path match the glob? Unsupported globs match nothing. */
export function matchGlob(glob, p) {
if (unsupported(glob)) return false;
return globToRegExp(glob).test(fold(toPosix(p)));
if (!compiled.has(glob)) compiled.set(glob, unsupported(glob) ? null : globToRegExp(glob));
const re = compiled.get(glob);
return re !== null && re.test(fold(toPosix(p)));
}