MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / hasExportDeclaration

Function hasExportDeclaration

src/extraction/languages/typescript.ts:137–143  ·  view source on GitHub ↗

A statement in `block` that exports by name or by assignment, not by declaring.

(block: SyntaxNode)

Source from the content-addressed store, hash-verified

135
136/** A statement in `block` that exports by name or by assignment, not by declaring. */
137function hasExportDeclaration(block: SyntaxNode): boolean {
138 for (let i = 0; i < block.namedChildCount; i++) {
139 const statement = block.namedChild(i);
140 if (statement?.type === 'export_statement' && !getChildByField(statement, 'declaration')) return true;
141 }
142 return false;
143}
144
145/** A TypeScript declaration file: `.d.ts`, `.d.mts`, `.d.cts`. */
146const DECLARATION_FILE = /\.d\.[cm]?ts$/i;

Callers 1

isAmbientExportFunction · 0.85

Calls 1

getChildByFieldFunction · 0.90

Tested by

no test coverage detected