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

Function getSourceFileLikeForImportDeclaration

test/fixtures/snapshot/typescript.js:136789–136799  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

136787 return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);
136788 }
136789 function getSourceFileLikeForImportDeclaration(node) {
136790 if (node.kind === 208 /* SyntaxKind.CallExpression */) {
136791 return node.getSourceFile();
136792 }
136793 var parent = node.parent;
136794 if (parent.kind === 305 /* SyntaxKind.SourceFile */) {
136795 return parent;
136796 }
136797 ts.Debug.assert(parent.kind === 262 /* SyntaxKind.ModuleBlock */);
136798 return ts.cast(parent.parent, isAmbientModuleDeclaration);
136799 }
136800 function isAmbientModuleDeclaration(node) {
136801 return node.kind === 261 /* SyntaxKind.ModuleDeclaration */ && node.name.kind === 10 /* SyntaxKind.StringLiteral */;
136802 }

Callers 4

handleDirectImportsFunction · 0.85
handleNamespaceImportFunction · 0.85
addIndirectUserFunction · 0.85

Calls 1

assertMethod · 0.80

Tested by

no test coverage detected