( importPath: string, fromFile: string, language: Language, context: ResolutionContext )
| 414 | } |
| 415 | |
| 416 | export function resolveImportPath( |
| 417 | importPath: string, |
| 418 | fromFile: string, |
| 419 | language: Language, |
| 420 | context: ResolutionContext |
| 421 | ): string | null { |
| 422 | let memo = importPathMemos.get(context); |
| 423 | if (!memo) { |
| 424 | memo = new Map(); |
| 425 | importPathMemos.set(context, memo); |
| 426 | } |
| 427 | const key = `${language}\0${fromFile}\0${importPath}`; |
| 428 | const hit = memo.get(key); |
| 429 | if (hit !== undefined || memo.has(key)) return hit ?? null; |
| 430 | const resolved = resolveImportPathUncached(importPath, fromFile, language, context); |
| 431 | memo.set(key, resolved); |
| 432 | return resolved; |
| 433 | } |
| 434 | |
| 435 | function resolveImportPathUncached( |
| 436 | importPath: string, |
no test coverage detected