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

Function getTargetModuleFromNamespaceLikeImport

test/fixtures/snapshot/typescript.js:153227–153240  ·  view source on GitHub ↗
(declaration, checker)

Source from the content-addressed store, hash-verified

153225 });
153226 }
153227 function getTargetModuleFromNamespaceLikeImport(declaration, checker) {
153228 var _a;
153229 switch (declaration.kind) {
153230 case 254 /* SyntaxKind.VariableDeclaration */:
153231 return checker.resolveExternalModuleName(declaration.initializer.arguments[0]);
153232 case 265 /* SyntaxKind.ImportEqualsDeclaration */:
153233 return checker.getAliasedSymbol(declaration.symbol);
153234 case 266 /* SyntaxKind.ImportDeclaration */:
153235 var namespaceImport = ts.tryCast((_a = declaration.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings, ts.isNamespaceImport);
153236 return namespaceImport && checker.getAliasedSymbol(namespaceImport.symbol);
153237 default:
153238 return ts.Debug.assertNever(declaration);
153239 }
153240 }
153241 function getNamespaceLikeImportText(declaration) {
153242 var _a, _b, _c;
153243 switch (declaration.kind) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected