Gracefully handle errors where 'typings' is not a string (fixes #4828)

This commit is contained in:
Tim Perry
2015-12-07 18:25:25 +01:00
parent 2ef436f082
commit 384ee18c7b
2 changed files with 23 additions and 2 deletions

View File

@@ -99,7 +99,7 @@ namespace ts {
jsonContent = { typings: undefined };
}
if (jsonContent.typings) {
if (typeof jsonContent.typings === "string") {
const result = loadNodeModuleFromFile(extensions, normalizePath(combinePaths(candidate, jsonContent.typings)), failedLookupLocation, host);
if (result) {
return result;