Support path that specified index

This commit is contained in:
Zhengbo Li
2017-01-04 13:35:42 -08:00
parent c67d1a4445
commit b19a949ce4
2 changed files with 30 additions and 1 deletions

View File

@@ -443,6 +443,7 @@ namespace ts.codefix {
return undefined;
}
const relativeNameWithIndex = removeFileExtension(relativeName);
relativeName = removeExtensionAndIndexPostFix(relativeName);
if (options.paths) {
@@ -462,7 +463,7 @@ namespace ts.codefix {
return key.replace("\*", matchedStar);
}
}
else if (pattern === relativeName) {
else if (pattern === relativeName || pattern === relativeNameWithIndex) {
return key;
}
}