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

Function forEachPossibleImportOrExportStatement

test/fixtures/snapshot/typescript.js:136557–136561  ·  view source on GitHub ↗

Iterates over all statements at the top level or in module declarations. Returns the first truthy result.

(sourceFileLike, action)

Source from the content-addressed store, hash-verified

136555 }
136556 /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */
136557 function forEachPossibleImportOrExportStatement(sourceFileLike, action) {
136558 return ts.forEach(sourceFileLike.kind === 305 /* SyntaxKind.SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) {
136559 return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action));
136560 });
136561 }
136562 /** Calls `action` for each import, re-export, or require() in a file. */
136563 function forEachImport(sourceFile, action) {
136564 if (sourceFile.externalModuleIndicator || sourceFile.imports !== undefined) {

Callers 2

findNamespaceReExportsFunction · 0.85
forEachImportFunction · 0.85

Calls 3

actionFunction · 0.85
forEachMethod · 0.65

Tested by

no test coverage detected