MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / getCachedFilePath

Function getCachedFilePath

packages/overlay/src/file-discovery-cache.ts:11–19  ·  view source on GitHub ↗
(componentName: string)

Source from the content-addressed store, hash-verified

9
10/** Returns filePath if cached and fresh, null if cached as not-found, undefined if not looked up. */
11export function getCachedFilePath(componentName: string): string | null | undefined {
12 const entry = cache.get(componentName);
13 if (!entry) return undefined;
14 if (Date.now() - entry.timestamp > CACHE_TTL_MS) {
15 cache.delete(componentName);
16 return undefined;
17 }
18 return entry.filePath;
19}
20
21export function setCachedFilePath(componentName: string, filePath: string | null): void {
22 cache.set(componentName, { filePath, timestamp: Date.now() });

Callers 5

selectElementFunction · 0.85
commitAndExitFunction · 0.85
resolveComponentAtPointFunction · 0.85
inspectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected