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

Function isAliasSymbolDeclaration

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

Source from the content-addressed store, hash-verified

17287 // const x = require("...").y
17288 // const { x } = require("...").y
17289 function isAliasSymbolDeclaration(node) {
17290 if (node.kind === 265 /* SyntaxKind.ImportEqualsDeclaration */ ||
17291 node.kind === 264 /* SyntaxKind.NamespaceExportDeclaration */ ||
17292 node.kind === 267 /* SyntaxKind.ImportClause */ && !!node.name ||
17293 node.kind === 268 /* SyntaxKind.NamespaceImport */ ||
17294 node.kind === 274 /* SyntaxKind.NamespaceExport */ ||
17295 node.kind === 270 /* SyntaxKind.ImportSpecifier */ ||
17296 node.kind === 275 /* SyntaxKind.ExportSpecifier */ ||
17297 node.kind === 271 /* SyntaxKind.ExportAssignment */ && exportAssignmentIsAlias(node)) {
17298 return true;
17299 }
17300 return isInJSFile(node) && (ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 2 /* AssignmentDeclarationKind.ModuleExports */ && exportAssignmentIsAlias(node) ||
17301 ts.isPropertyAccessExpression(node)
17302 && ts.isBinaryExpression(node.parent)
17303 && node.parent.left === node
17304 && node.parent.operatorToken.kind === 63 /* SyntaxKind.EqualsToken */
17305 && isAliasableExpression(node.parent.right));
17306 }
17307 ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration;
17308 function getAliasDeclarationFromName(node) {
17309 switch (node.parent.kind) {

Callers 2

Calls 5

exportAssignmentIsAliasFunction · 0.85
isInJSFileFunction · 0.85
isAliasableExpressionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…