MCPcopy Index your code
hub / github.com/nodejs/node / loadJSOrExactTSFileName

Function loadJSOrExactTSFileName

test/fixtures/snapshot/typescript.js:43545–43551  ·  view source on GitHub ↗
(extensions, candidate, onlyRecordFailures, state)

Source from the content-addressed store, hash-verified

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);
43548 return result !== undefined ? { path: candidate, ext: ts.tryExtractTSExtension(candidate) } : undefined;
43549 }
43550 return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state);
43551 }
43552 /** Try to return an existing file that adds one of the `extensions` to `candidate`. */
43553 function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) {
43554 if (!onlyRecordFailures) {

Calls 2

tryFileFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…