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

Function isFileProbablyExternalModule

test/fixtures/snapshot/typescript.js:30687–30692  ·  view source on GitHub ↗
(sourceFile)

Source from the content-addressed store, hash-verified

30685 ts.isJSDocLikeText = isJSDocLikeText;
30686 /*@internal*/
30687 function isFileProbablyExternalModule(sourceFile) {
30688 // Try to use the first top-level import/export when available, then
30689 // fall back to looking for an 'import.meta' somewhere in the tree if necessary.
30690 return ts.forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
30691 getImportMetaIfNecessary(sourceFile);
30692 }
30693 ts.isFileProbablyExternalModule = isFileProbablyExternalModule;
30694 function isAnExternalModuleIndicatorNode(node) {
30695 return hasModifierOfKind(node, 93 /* SyntaxKind.ExportKeyword */)

Callers 1

Calls 2

getImportMetaIfNecessaryFunction · 0.85
forEachMethod · 0.65

Tested by

no test coverage detected