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

Function getMatchedFileSpec

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

Source from the content-addressed store, hash-verified

122896 }
122897 ts.explainIfFileIsRedirect = explainIfFileIsRedirect;
122898 function getMatchedFileSpec(program, fileName) {
122899 var _a;
122900 var configFile = program.getCompilerOptions().configFile;
122901 if (!((_a = configFile === null || configFile === void 0 ? void 0 : configFile.configFileSpecs) === null || _a === void 0 ? void 0 : _a.validatedFilesSpec))
122902 return undefined;
122903 var getCanonicalFileName = ts.createGetCanonicalFileName(program.useCaseSensitiveFileNames());
122904 var filePath = getCanonicalFileName(fileName);
122905 var basePath = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
122906 return ts.find(configFile.configFileSpecs.validatedFilesSpec, function (fileSpec) { return getCanonicalFileName(ts.getNormalizedAbsolutePath(fileSpec, basePath)) === filePath; });
122907 }
122908 ts.getMatchedFileSpec = getMatchedFileSpec;
122909 function getMatchedIncludeSpec(program, fileName) {
122910 var _a, _b;

Callers 1

Calls 2

getCanonicalFileNameFunction · 0.85
findMethod · 0.65

Tested by

no test coverage detected