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

Function addIndirectUser

test/fixtures/snapshot/typescript.js:136347–136369  ·  view source on GitHub ↗

Adds a module and all of its transitive dependencies as possible indirect users.

(sourceFileLike, addTransitiveDependencies)

Source from the content-addressed store, hash-verified

136345 }
136346 /** Adds a module and all of its transitive dependencies as possible indirect users. */
136347 function addIndirectUser(sourceFileLike, addTransitiveDependencies) {
136348 if (addTransitiveDependencies === void 0) { addTransitiveDependencies = false; }
136349 ts.Debug.assert(!isAvailableThroughGlobal);
136350 var isNew = markSeenIndirectUser(sourceFileLike);
136351 if (!isNew)
136352 return;
136353 indirectUserDeclarations.push(sourceFileLike); // TODO: GH#18217
136354 if (!addTransitiveDependencies)
136355 return;
136356 var moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol);
136357 if (!moduleSymbol)
136358 return;
136359 ts.Debug.assert(!!(moduleSymbol.flags & 1536 /* SymbolFlags.Module */));
136360 var directImports = getDirectImports(moduleSymbol);
136361 if (directImports) {
136362 for (var _i = 0, directImports_1 = directImports; _i < directImports_1.length; _i++) {
136363 var directImport = directImports_1[_i];
136364 if (!ts.isImportTypeNode(directImport)) {
136365 addIndirectUser(getSourceFileLikeForImportDeclaration(directImport), /** addTransitiveDependencies */ true);
136366 }
136367 }
136368 }
136369 }
136370 function getDirectImports(moduleSymbol) {
136371 return allDirectImports.get(ts.getSymbolId(moduleSymbol).toString());
136372 }

Callers 4

getIndirectUsersFunction · 0.85
handleDirectImportsFunction · 0.85
handleImportCallFunction · 0.85
handleNamespaceImportFunction · 0.85

Calls 4

getDirectImportsFunction · 0.85
assertMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected