Correctly resolve imports ending with "." and ".." (#47850)

This commit is contained in:
Andrew Branch
2022-02-11 11:14:07 -08:00
committed by GitHub
parent 73506f3512
commit 7f022c58fb
22 changed files with 137 additions and 56 deletions
-12
View File
@@ -585,18 +585,6 @@ namespace ts {
return getCanonicalFileName(nonCanonicalizedPath) as Path;
}
export function normalizePathAndParts(path: string): { path: string, parts: string[] } {
path = normalizeSlashes(path);
const [root, ...parts] = reducePathComponents(getPathComponents(path));
if (parts.length) {
const joinedParts = root + parts.join(directorySeparator);
return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts };
}
else {
return { path: root, parts };
}
}
//// Path Mutation
/**