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

Function getFirstProjectOutput

test/fixtures/snapshot/typescript.js:110202–110225  ·  view source on GitHub ↗
(configFile, ignoreCase)

Source from the content-addressed store, hash-verified

110200 ts.getOutputFileNames = getOutputFileNames;
110201 /*@internal*/
110202 function getFirstProjectOutput(configFile, ignoreCase) {
110203 if (ts.outFile(configFile.options)) {
110204 var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
110205 return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
110206 }
110207 var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
110208 for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
110209 var inputFileName = _b[_a];
110210 if (ts.isDeclarationFileName(inputFileName))
110211 continue;
110212 var jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
110213 if (jsFilePath)
110214 return jsFilePath;
110215 if (ts.fileExtensionIs(inputFileName, ".json" /* Extension.Json */))
110216 continue;
110217 if (ts.getEmitDeclarations(configFile.options)) {
110218 return getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
110219 }
110220 }
110221 var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
110222 if (buildInfoPath)
110223 return buildInfoPath;
110224 return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
110225 }
110226 ts.getFirstProjectOutput = getFirstProjectOutput;
110227 /*@internal*/
110228 // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature

Callers

nothing calls this directly

Calls 7

getOutputPathsForBundleFunction · 0.85
getOutputJSFileNameFunction · 0.85
concatMethod · 0.80
failMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…