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

Function getSourceMapDirectory

test/fixtures/snapshot/typescript.js:110478–110495  ·  view source on GitHub ↗
(mapOptions, filePath, sourceFile)

Source from the content-addressed store, hash-verified

110476 return sourceRoot ? ts.ensureTrailingDirectorySeparator(sourceRoot) : sourceRoot;
110477 }
110478 function getSourceMapDirectory(mapOptions, filePath, sourceFile) {
110479 if (mapOptions.sourceRoot)
110480 return host.getCommonSourceDirectory();
110481 if (mapOptions.mapRoot) {
110482 var sourceMapDir = ts.normalizeSlashes(mapOptions.mapRoot);
110483 if (sourceFile) {
110484 // For modules or multiple emit files the mapRoot will have directory structure like the sources
110485 // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map
110486 sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFile.fileName, host, sourceMapDir));
110487 }
110488 if (ts.getRootLength(sourceMapDir) === 0) {
110489 // The relative paths are relative to the common directory
110490 sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir);
110491 }
110492 return sourceMapDir;
110493 }
110494 return ts.getDirectoryPath(ts.normalizePath(filePath));
110495 }
110496 function getSourceMappingURL(mapOptions, sourceMapGenerator, filePath, sourceMapFilePath, sourceFile) {
110497 if (mapOptions.inlineSourceMap) {
110498 // Encode the sourceMap into the sourceMap url

Callers 1

printSourceFileOrBundleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected