import statement from "node" in js source file could produce correct declaration path. (#41816)

* fix #41800

* add test

* fix test
This commit is contained in:
Song Gao authored and GitHub committed 2020-12-07 13:54:47 +00:00
1 parent bf977ed918
commit 37e898cfd7
5 files changed
+139 -1

No files matched your search

+2 -1
View File
@@ -1422,7 +1422,8 @@ namespace ts {
export function getPackageNameFromTypesPackageName(mangledName: string): string {
const withoutAtTypePrefix = removePrefix(mangledName, "@types/");
if (withoutAtTypePrefix !== mangledName) {
return unmangleScopedPackageName(withoutAtTypePrefix);
const withoutAtTypeNodePrefix = removePrefix(withoutAtTypePrefix, "node/");
return unmangleScopedPackageName(withoutAtTypeNodePrefix);
}
return mangledName;
}