( importPath: string, fromFile: string, language: Language, context: ResolutionContext )
| 433 | } |
| 434 | |
| 435 | export function resolveImportPath( |
| 436 | importPath: string, |
| 437 | fromFile: string, |
| 438 | language: Language, |
| 439 | context: ResolutionContext |
| 440 | ): string | null { |
| 441 | let memo = importPathMemos.get(context); |
| 442 | if (!memo) { |
| 443 | memo = new Map(); |
| 444 | importPathMemos.set(context, memo); |
| 445 | } |
| 446 | const key = `${language}\0${fromFile}\0${importPath}`; |
| 447 | const hit = memo.get(key); |
| 448 | if (hit !== undefined || memo.has(key)) return hit ?? null; |
| 449 | const resolved = resolveImportPathUncached(importPath, fromFile, language, context); |
| 450 | memo.set(key, resolved); |
| 451 | return resolved; |
| 452 | } |
| 453 | |
| 454 | function resolveImportPathUncached( |
| 455 | importPath: string, |
no test coverage detected