MCPcopy Create free account
hub / github.com/nodejs/node / getExportNode

Function getExportNode

test/fixtures/snapshot/typescript.js:136727–136736  ·  view source on GitHub ↗
(parent, node)

Source from the content-addressed store, hash-verified

136725 // If a reference is a class expression, the exported node would be its parent.
136726 // If a reference is a variable declaration, the exported node would be the variable statement.
136727 function getExportNode(parent, node) {
136728 var declaration = ts.isVariableDeclaration(parent) ? parent : ts.isBindingElement(parent) ? ts.walkUpBindingElementsAndPatterns(parent) : undefined;
136729 if (declaration) {
136730 return parent.name !== node ? undefined :
136731 ts.isCatchClause(declaration.parent) ? undefined : ts.isVariableStatement(declaration.parent.parent) ? declaration.parent.parent : undefined;
136732 }
136733 else {
136734 return parent;
136735 }
136736 }
136737 function isNodeImport(node) {
136738 var parent = node.parent;
136739 switch (parent.kind) {

Callers 1

getExportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected