Improve error message for untyped import of scoped package (#22189)

This commit is contained in:
Andy authored and GitHub committed 2018-02-26 10:38:54 -08:00
1 parent b31aa4e012
commit e4e4b17669
7 files changed
+53 -2

No files matched your search

+2 -1
View File
@@ -1157,7 +1157,8 @@ namespace ts {
return `@types/${getMangledNameForScopedPackage(packageName)}`;
}
function getMangledNameForScopedPackage(packageName: string): string {
/* @internal */
export function getMangledNameForScopedPackage(packageName: string): string {
if (startsWith(packageName, "@")) {
const replaceSlash = packageName.replace(ts.directorySeparator, mangledScopedPackageSeparator);
if (replaceSlash !== packageName) {