mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-28 20:05:02 +00:00
Tests: extend exec allowlist glob coverage
This commit is contained in:
@@ -25,7 +25,8 @@ function escapeRegExpLiteral(input: string): string {
|
||||
}
|
||||
|
||||
function compileGlobRegex(pattern: string): RegExp {
|
||||
const cached = globRegexCache.get(pattern);
|
||||
const cacheKey = `${process.platform}:${pattern}`;
|
||||
const cached = globRegexCache.get(cacheKey);
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
@@ -59,7 +60,7 @@ function compileGlobRegex(pattern: string): RegExp {
|
||||
if (globRegexCache.size >= GLOB_REGEX_CACHE_LIMIT) {
|
||||
globRegexCache.clear();
|
||||
}
|
||||
globRegexCache.set(pattern, compiled);
|
||||
globRegexCache.set(cacheKey, compiled);
|
||||
return compiled;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user