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

Function addSource

test/fixtures/snapshot/typescript.js:90025–90038  ·  view source on GitHub ↗
(fileName)

Source from the content-addressed store, hash-verified

90023 toString: function () { return JSON.stringify(toJSON()); }
90024 };
90025 function addSource(fileName) {
90026 enter();
90027 var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, fileName, host.getCurrentDirectory(), host.getCanonicalFileName,
90028 /*isAbsolutePathAnUrl*/ true);
90029 var sourceIndex = sourceToSourceIndexMap.get(source);
90030 if (sourceIndex === undefined) {
90031 sourceIndex = sources.length;
90032 sources.push(source);
90033 rawSources.push(fileName);
90034 sourceToSourceIndexMap.set(source, sourceIndex);
90035 }
90036 exit();
90037 return sourceIndex;
90038 }
90039 /* eslint-disable boolean-trivia, no-null/no-null */
90040 function setSourceContent(sourceIndex, content) {
90041 enter();

Callers 1

appendSourceMapFunction · 0.85

Calls 5

enterFunction · 0.70
exitFunction · 0.70
getMethod · 0.65
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…