MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / moduleDocstring

Function moduleDocstring

graph-ui/src/browser-ai/code-facts.ts:153–158  ·  view source on GitHub ↗

The first line of a Python module docstring.

(lines: readonly string[])

Source from the content-addressed store, hash-verified

151
152/** The first line of a Python module docstring. */
153function moduleDocstring(lines: readonly string[]): string | undefined {
154 const at = lines.findIndex(line => line.trim() && !line.trim().startsWith('#'));
155 const doc = at >= 0 ? docstring(lines, at - 1, '') : [];
156 const text = doc.at(-1)?.replace(/^[rubRUB]{0,2}("""|''')/, '').replace(/("""|''')$/, '').trim();
157 return text || undefined;
158}
159
160/** An open code file or marked code as facts read from it, for a short general question: what it
161 * is and how long, a module's docstring, its definitions, and the code facts of a single marked

Callers 1

codeSourceFactsFunction · 0.85

Calls 1

docstringFunction · 0.85

Tested by

no test coverage detected