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

Function getEffectiveTypeAnnotationNode

test/fixtures/snapshot/typescript.js:18644–18651  ·  view source on GitHub ↗

* Gets the effective type annotation of a variable, parameter, or property. If the node was * parsed in a JavaScript file, gets the type annotation from JSDoc. Also gets the type of * functions only the JSDoc case.

(node)

Source from the content-addressed store, hash-verified

18642 * functions only the JSDoc case.
18643 */
18644 function getEffectiveTypeAnnotationNode(node) {
18645 if (!isInJSFile(node) && ts.isFunctionDeclaration(node))
18646 return undefined;
18647 var type = node.type;
18648 if (type || !isInJSFile(node))
18649 return type;
18650 return ts.isJSDocPropertyLikeTag(node) ? node.typeExpression && node.typeExpression.type : ts.getJSDocType(node);
18651 }
18652 ts.getEffectiveTypeAnnotationNode = getEffectiveTypeAnnotationNode;
18653 function getTypeAnnotationNode(node) {
18654 return node.type;

Calls 1

isInJSFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…