(path: string, fromResolvedPath: ResolvedPath)
| 70 | absolutePath: absolutePath, |
| 71 | }; |
| 72 | } |
| 73 | |
| 74 | function resolveAbsoluteImportFromPath(path: string): ResolvedPath { |
| 75 | return resolveAbsoluteImport(normalizePath(path.split('/'))); |
| 76 | } |
| 77 | |
| 78 | function resolvePath(path: string, fromResolvedPath: ResolvedPath): ResolvedPath { |
| 79 | const importPathEntries = path.split('/'); |
| 80 | if (importPathEntries[0] === '.' || importPathEntries[0] === '..') { |
| 81 | // Relative import |
| 82 | |
| 83 | const combinedPath = fromResolvedPath.directoryPaths.slice(); |
| 84 | combinedPath.push(...importPathEntries); |
| 85 | const normalized = normalizePath(combinedPath); |
| 86 | return resolveAbsoluteImport(normalized); |
| 87 | } else { |
| 88 | // Absolute import |
| 89 | const normalized = normalizePath(importPathEntries); |
no test coverage detected