(componentName: string)
| 9 | |
| 10 | /** Returns filePath if cached and fresh, null if cached as not-found, undefined if not looked up. */ |
| 11 | export 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 | |
| 21 | export function setCachedFilePath(componentName: string, filePath: string | null): void { |
| 22 | cache.set(componentName, { filePath, timestamp: Date.now() }); |
no outgoing calls
no test coverage detected