fix(rules-injector): cache directory scan results per session

This commit is contained in:
Sisyphus
2026-04-18 14:13:51 +09:00
parent c5b7aa8e4b
commit 52512f226a
5 changed files with 182 additions and 79 deletions
@@ -0,0 +1,21 @@
export type RuleScanCache = {
get: (key: string) => string[] | undefined;
set: (key: string, value: string[]) => void;
clear: () => void;
};
export function createRuleScanCache(): RuleScanCache {
const cache = new Map<string, string[]>();
return {
get(key: string): string[] | undefined {
return cache.get(key);
},
set(key: string, value: string[]): void {
cache.set(key, value);
},
clear(): void {
cache.clear();
},
};
}