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

Function handleNamespaceImport

test/fixtures/snapshot/typescript.js:136329–136345  ·  view source on GitHub ↗
(importDeclaration, name, isReExport, alreadyAddedDirect)

Source from the content-addressed store, hash-verified

136327 });
136328 }
136329 function handleNamespaceImport(importDeclaration, name, isReExport, alreadyAddedDirect) {
136330 if (exportKind === 2 /* ExportKind.ExportEquals */) {
136331 // This is a direct import, not import-as-namespace.
136332 if (!alreadyAddedDirect)
136333 directImports.push(importDeclaration);
136334 }
136335 else if (!isAvailableThroughGlobal) {
136336 var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration);
136337 ts.Debug.assert(sourceFileLike.kind === 305 /* SyntaxKind.SourceFile */ || sourceFileLike.kind === 261 /* SyntaxKind.ModuleDeclaration */);
136338 if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) {
136339 addIndirectUser(sourceFileLike, /** addTransitiveDependencies */ true);
136340 }
136341 else {
136342 addIndirectUser(sourceFileLike);
136343 }
136344 }
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; }

Callers 1

handleDirectImportsFunction · 0.85

Calls 5

findNamespaceReExportsFunction · 0.85
addIndirectUserFunction · 0.85
assertMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected