( projectRoot: string, kind: "code", )
| 262 | * Returns `null` (wrapped in Promise) when the walk fails (perms, etc). |
| 263 | */ |
| 264 | export function warmFileListCache( |
| 265 | projectRoot: string, |
| 266 | kind: "code", |
| 267 | ): Promise<string[] | null> { |
| 268 | const key = fileListCacheKey(projectRoot, kind); |
| 269 | const entry = fileListCache.get(key); |
| 270 | if (entry && Date.now() - entry.startedAt < FILE_LIST_CACHE_TTL_MS) { |
| 271 | return entry.promise; |
| 272 | } |
| 273 | const promise = startCodeWalk(projectRoot); |
| 274 | fileListCache.set(key, { promise, startedAt: Date.now() }); |
| 275 | return promise; |
| 276 | } |
| 277 | |
| 278 | /** |
| 279 | * Resolve a code-file path within a project root. |
no test coverage detected