( importPath: string, fromFile: string, language: Language, context: ResolutionContext )
| 111 | } |
| 112 | |
| 113 | export function resolveImportPath( |
| 114 | importPath: string, |
| 115 | fromFile: string, |
| 116 | language: Language, |
| 117 | context: ResolutionContext |
| 118 | ): string | null { |
| 119 | let memo = importPathMemos.get(context); |
| 120 | if (!memo) { |
| 121 | memo = new Map(); |
| 122 | importPathMemos.set(context, memo); |
| 123 | } |
| 124 | const key = `${language}\0${fromFile}\0${importPath}`; |
| 125 | const hit = memo.get(key); |
| 126 | if (hit !== undefined || memo.has(key)) return hit ?? null; |
| 127 | const resolved = resolveImportPathUncached(importPath, fromFile, language, context); |
| 128 | memo.set(key, resolved); |
| 129 | return resolved; |
| 130 | } |
| 131 | |
| 132 | function resolveImportPathUncached( |
| 133 | importPath: string, |
no test coverage detected