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

Function findNamespaceReExports

test/fixtures/snapshot/typescript.js:136494–136503  ·  view source on GitHub ↗

Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally.

(sourceFileLike, name, checker)

Source from the content-addressed store, hash-verified

136492 }
136493 /** Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally. */
136494 function findNamespaceReExports(sourceFileLike, name, checker) {
136495 var namespaceImportSymbol = checker.getSymbolAtLocation(name);
136496 return !!forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) {
136497 if (!ts.isExportDeclaration(statement))
136498 return;
136499 var exportClause = statement.exportClause, moduleSpecifier = statement.moduleSpecifier;
136500 return !moduleSpecifier && exportClause && ts.isNamedExports(exportClause) &&
136501 exportClause.elements.some(function (element) { return checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol; });
136502 });
136503 }
136504 function findModuleReferences(program, sourceFiles, searchModuleSymbol) {
136505 var refs = [];
136506 var checker = program.getTypeChecker();

Callers 1

handleNamespaceImportFunction · 0.85

Calls 2

someMethod · 0.80

Tested by

no test coverage detected