Consistently use variable mangledScopedPackageSeparator instead of magic "__" string (#16713)

This commit is contained in:
Andy 2017-06-26 11:10:57 -07:00 committed by GitHub
parent fd22a88abc
commit aeb5264b74

View File

@ -995,7 +995,7 @@ namespace ts {
export function getPackageNameFromAtTypesDirectory(mangledName: string): string {
const withoutAtTypePrefix = removePrefix(mangledName, "@types/");
if (withoutAtTypePrefix !== mangledName) {
return withoutAtTypePrefix.indexOf("__") !== -1 ?
return withoutAtTypePrefix.indexOf(mangledScopedPackageSeparator) !== -1 ?
"@" + withoutAtTypePrefix.replace(mangledScopedPackageSeparator, ts.directorySeparator) :
withoutAtTypePrefix;
}