* 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)
| 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; |
no test coverage detected
searching dependent graphs…