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

Function getTypingNamesFromSourceFileNames

test/fixtures/snapshot/typescript.js:125904–125921  ·  view source on GitHub ↗

* Infer typing names from given file names. For example, the file name "jquery-min.2.3.4.js" * should be inferred to the 'jquery' typing name; and "angular-route.1.2.3.js" should be inferred * to the 'angular-route' typing name. * @param fileNames are the names

(fileNames)

Source from the content-addressed store, hash-verified

125902 * @param fileNames are the names for source files in the project
125903 */
125904 function getTypingNamesFromSourceFileNames(fileNames) {
125905 var fromFileNames = ts.mapDefined(fileNames, function (j) {
125906 if (!ts.hasJSFileExtension(j))
125907 return undefined;
125908 var inferredTypingName = ts.removeFileExtension(ts.getBaseFileName(j.toLowerCase()));
125909 var cleanedTypingName = ts.removeMinAndVersionNumbers(inferredTypingName);
125910 return safeList.get(cleanedTypingName);
125911 });
125912 if (fromFileNames.length) {
125913 addInferredTypings(fromFileNames, "Inferred typings from file names");
125914 }
125915 var hasJsxFile = ts.some(fileNames, function (f) { return ts.fileExtensionIs(f, ".jsx" /* Extension.Jsx */); });
125916 if (hasJsxFile) {
125917 if (log)
125918 log("Inferred 'react' typings due to presence of '.jsx' extension");
125919 addInferredTyping("react");
125920 }
125921 }
125922 }
125923 JsTyping.discoverTypings = discoverTypings;
125924 var NameValidationResult;

Callers 1

discoverTypingsFunction · 0.85

Calls 5

addInferredTypingsFunction · 0.85
addInferredTypingFunction · 0.85
someMethod · 0.80
logFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…