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

Function getTopLevelDeclarationStatement

test/fixtures/snapshot/typescript.js:162629–162638  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

162627 return ts.isExpressionStatement(d) ? ts.tryCast(d.expression.left.name, ts.isIdentifier) : ts.tryCast(d.name, ts.isIdentifier);
162628 }
162629 function getTopLevelDeclarationStatement(d) {
162630 switch (d.kind) {
162631 case 254 /* SyntaxKind.VariableDeclaration */:
162632 return d.parent.parent;
162633 case 203 /* SyntaxKind.BindingElement */:
162634 return getTopLevelDeclarationStatement(ts.cast(d.parent.parent, function (p) { return ts.isVariableDeclaration(p) || ts.isBindingElement(p); }));
162635 default:
162636 return d;
162637 }
162638 }
162639 function addExportToChanges(sourceFile, decl, name, changes, useEs6Exports) {
162640 if (isExported(sourceFile, decl, useEs6Exports, name))
162641 return;

Calls

no outgoing calls

Tested by

no test coverage detected