MCPcopy Create free account
hub / github.com/nodejs/node / getMatchedIncludeSpec

Function getMatchedIncludeSpec

test/fixtures/snapshot/typescript.js:122909–122923  ·  view source on GitHub ↗
(program, fileName)

Source from the content-addressed store, hash-verified

122907 }
122908 ts.getMatchedFileSpec = getMatchedFileSpec;
122909 function getMatchedIncludeSpec(program, fileName) {
122910 var _a, _b;
122911 var configFile = program.getCompilerOptions().configFile;
122912 if (!((_a = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _a === void 0 ? void 0 : _a.validatedIncludeSpecs))
122913 return undefined;
122914 var isJsonFile = ts.fileExtensionIs(fileName, ".json" /* Extension.Json */);
122915 var basePath = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
122916 var useCaseSensitiveFileNames = program.useCaseSensitiveFileNames();
122917 return ts.find((_b = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _b === void 0 ? void 0 : _b.validatedIncludeSpecs, function (includeSpec) {
122918 if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Extension.Json */))
122919 return false;
122920 var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
122921 return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
122922 });
122923 }
122924 ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
122925 function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {
122926 var _a, _b;

Callers 1

Calls 3

concatMethod · 0.80
findMethod · 0.65
testMethod · 0.45

Tested by

no test coverage detected