Return the file if it exists.
(fileName, onlyRecordFailures, state)
| 43618 | } |
| 43619 | /** Return the file if it exists. */ |
| 43620 | function tryFile(fileName, onlyRecordFailures, state) { |
| 43621 | var _a, _b; |
| 43622 | if (!((_a = state.compilerOptions.moduleSuffixes) === null || _a === void 0 ? void 0 : _a.length)) { |
| 43623 | return tryFileLookup(fileName, onlyRecordFailures, state); |
| 43624 | } |
| 43625 | var ext = (_b = ts.tryGetExtensionFromPath(fileName)) !== null && _b !== void 0 ? _b : ""; |
| 43626 | var fileNameNoExtension = ext ? ts.removeExtension(fileName, ext) : fileName; |
| 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)) { |
no test coverage detected
searching dependent graphs…