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

Function getTargetOfImportEqualsDeclaration

test/fixtures/snapshot/typescript.js:50394–50411  ·  view source on GitHub ↗
(node, dontResolveAlias)

Source from the content-addressed store, hash-verified

50392 return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
50393 }
50394 function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) {
50395 var commonJSPropertyAccess = getCommonJSPropertyAccess(node);
50396 if (commonJSPropertyAccess) {
50397 var name = ts.getLeftmostAccessExpression(commonJSPropertyAccess.expression).arguments[0];
50398 return ts.isIdentifier(commonJSPropertyAccess.name)
50399 ? resolveSymbol(getPropertyOfType(resolveExternalModuleTypeByLiteral(name), commonJSPropertyAccess.name.escapedText))
50400 : undefined;
50401 }
50402 if (ts.isVariableDeclaration(node) || node.moduleReference.kind === 277 /* SyntaxKind.ExternalModuleReference */) {
50403 var immediate = resolveExternalModuleName(node, ts.getExternalModuleRequireArgument(node) || ts.getExternalModuleImportEqualsDeclarationExpression(node));
50404 var resolved_4 = resolveExternalModuleSymbol(immediate);
50405 markSymbolOfAliasDeclarationIfTypeOnly(node, immediate, resolved_4, /*overwriteEmpty*/ false);
50406 return resolved_4;
50407 }
50408 var resolved = getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias);
50409 checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved);
50410 return resolved;
50411 }
50412 function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {
50413 if (markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false) && !node.isTypeOnly) {
50414 var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));

Callers 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…