(extensions, candidate, onlyRecordFailures, state)
| 43531 | return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state); |
| 43532 | } |
| 43533 | function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) { |
| 43534 | // If that didn't work, try stripping a ".js" or ".jsx" extension and replacing it with a TypeScript one; |
| 43535 | // e.g. "./foo.js" can be matched by "./foo.ts" or "./foo.d.ts" |
| 43536 | if (ts.hasJSFileExtension(candidate) || (ts.fileExtensionIs(candidate, ".json" /* Extension.Json */) && state.compilerOptions.resolveJsonModule)) { |
| 43537 | var extensionless = ts.removeFileExtension(candidate); |
| 43538 | var extension = candidate.substring(extensionless.length); |
| 43539 | if (state.traceEnabled) { |
| 43540 | trace(state.host, ts.Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension); |
| 43541 | } |
| 43542 | return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state); |
| 43543 | } |
| 43544 | } |
| 43545 | function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) { |
| 43546 | if ((extensions === Extensions.TypeScript || extensions === Extensions.DtsOnly) && ts.fileExtensionIsOneOf(candidate, ts.supportedTSExtensionsFlat)) { |
| 43547 | var result = tryFile(candidate, onlyRecordFailures, state); |
no test coverage detected
searching dependent graphs…