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

Function getExternalModuleNameFromPath

test/fixtures/snapshot/typescript.js:18397–18404  ·  view source on GitHub ↗

* Resolves a local path to a path which is absolute to the base of the emit

(host, fileName, referencePath)

Source from the content-addressed store, hash-verified

18395 * Resolves a local path to a path which is absolute to the base of the emit
18396 */
18397 function getExternalModuleNameFromPath(host, fileName, referencePath) {
18398 var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); };
18399 var dir = ts.toPath(referencePath ? ts.getDirectoryPath(referencePath) : host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName);
18400 var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory());
18401 var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);
18402 var extensionless = removeFileExtension(relativePath);
18403 return referencePath ? ts.ensurePathIsNonModuleName(extensionless) : extensionless;
18404 }
18405 ts.getExternalModuleNameFromPath = getExternalModuleNameFromPath;
18406 function getOwnEmitOutputFilePath(fileName, host, extension) {
18407 var compilerOptions = host.getCompilerOptions();

Callers 1

Calls 1

removeFileExtensionFunction · 0.85

Tested by

no test coverage detected