| 43627 | return ts.forEach(state.compilerOptions.moduleSuffixes, function (suffix) { return tryFileLookup(fileNameNoExtension + suffix + ext, onlyRecordFailures, state); }); |
| 43628 | } |
| 43629 | function tryFileLookup(fileName, onlyRecordFailures, state) { |
| 43630 | if (!onlyRecordFailures) { |
| 43631 | if (state.host.fileExists(fileName)) { |
| 43632 | if (state.traceEnabled) { |
| 43633 | trace(state.host, ts.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); |
| 43634 | } |
| 43635 | return fileName; |
| 43636 | } |
| 43637 | else { |
| 43638 | if (state.traceEnabled) { |
| 43639 | trace(state.host, ts.Diagnostics.File_0_does_not_exist, fileName); |
| 43640 | } |
| 43641 | } |
| 43642 | } |
| 43643 | state.failedLookupLocations.push(fileName); |
| 43644 | return undefined; |
| 43645 | } |
| 43646 | function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson) { |
| 43647 | if (considerPackageJson === void 0) { considerPackageJson = true; } |
| 43648 | var packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : undefined; |