(spec: string, importerDir: string)
| 749 | } |
| 750 | |
| 751 | function normalizeImportPath(spec: string, importerDir: string): string | null { |
| 752 | if (!spec) return null; |
| 753 | |
| 754 | let key: string; |
| 755 | if (spec.startsWith('/')) { |
| 756 | key = spec; |
| 757 | } else if (spec.startsWith('./') || spec.startsWith('../')) { |
| 758 | key = path.posix.normalize(path.posix.join(importerDir, spec)); |
| 759 | if (!key.startsWith('/')) { |
| 760 | key = '/' + key; |
| 761 | } |
| 762 | } else { |
| 763 | key = spec; |
| 764 | } |
| 765 | |
| 766 | return key.replace(PAT.QUERY_PATTERN, ''); |
| 767 | } |
| 768 | |
| 769 | function registerDependencyFile(depFileMap: Map<string, string>, candidate: string | null, fileName: string): void { |
| 770 | if (!candidate) return; |
no test coverage detected