mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user