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

Function isInImport

test/fixtures/snapshot/typescript.js:162470–162484  ·  view source on GitHub ↗
(decl)

Source from the content-addressed store, hash-verified

162468 }
162469 // Below should all be utilities
162470 function isInImport(decl) {
162471 switch (decl.kind) {
162472 case 265 /* SyntaxKind.ImportEqualsDeclaration */:
162473 case 270 /* SyntaxKind.ImportSpecifier */:
162474 case 267 /* SyntaxKind.ImportClause */:
162475 case 268 /* SyntaxKind.NamespaceImport */:
162476 return true;
162477 case 254 /* SyntaxKind.VariableDeclaration */:
162478 return isVariableDeclarationInImport(decl);
162479 case 203 /* SyntaxKind.BindingElement */:
162480 return ts.isVariableDeclaration(decl.parent.parent) && isVariableDeclarationInImport(decl.parent.parent);
162481 default:
162482 return false;
162483 }
162484 }
162485 function isVariableDeclarationInImport(decl) {
162486 return ts.isSourceFile(decl.parent.parent.parent) &&
162487 !!decl.initializer && ts.isRequireCall(decl.initializer, /*checkArgumentIsStringLiteralLike*/ true);

Callers 1

getUsageInfoFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…