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

Function collapse

src/extraction/languages/cobol.ts:56–59  ·  view source on GitHub ↗

Collapse whitespace runs so multi-line clauses read as one signature.

(text: string, cap = 120)

Source from the content-addressed store, hash-verified

54
55/** Collapse whitespace runs so multi-line clauses read as one signature. */
56function collapse(text: string, cap = 120): string {
57 const flat = text.replace(/\s+/g, ' ').trim();
58 return flat.length > cap ? flat.slice(0, cap - 1) + '…' : flat;
59}
60
61function currentScope(ctx: ExtractorContext): string | undefined {
62 return ctx.nodeStack[ctx.nodeStack.length - 1];

Callers 3

handleCopyFunction · 0.85
handleExecFunction · 0.85
walkDataEntriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected