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

Function isTypeDeclaration

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

Source from the content-addressed store, hash-verified

86161 ts.getNameOfDeclaration(name.parent) === name;
86162 }
86163 function isTypeDeclaration(node) {
86164 switch (node.kind) {
86165 case 163 /* SyntaxKind.TypeParameter */:
86166 case 257 /* SyntaxKind.ClassDeclaration */:
86167 case 258 /* SyntaxKind.InterfaceDeclaration */:
86168 case 259 /* SyntaxKind.TypeAliasDeclaration */:
86169 case 260 /* SyntaxKind.EnumDeclaration */:
86170 case 345 /* SyntaxKind.JSDocTypedefTag */:
86171 case 338 /* SyntaxKind.JSDocCallbackTag */:
86172 case 339 /* SyntaxKind.JSDocEnumTag */:
86173 return true;
86174 case 267 /* SyntaxKind.ImportClause */:
86175 return node.isTypeOnly;
86176 case 270 /* SyntaxKind.ImportSpecifier */:
86177 case 275 /* SyntaxKind.ExportSpecifier */:
86178 return node.parent.parent.isTypeOnly;
86179 default:
86180 return false;
86181 }
86182 }
86183 // True if the given identifier is part of a type reference
86184 function isTypeReferenceIdentifier(node) {
86185 while (node.parent.kind === 161 /* SyntaxKind.QualifiedName */) {

Callers 5

canHaveExportModifierFunction · 0.85
checkTypeReferenceNodeFunction · 0.85
errorUnusedLocalFunction · 0.85
isTypeDeclarationNameFunction · 0.85
getTypeOfNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…