MCPcopy Create free account
hub / github.com/garrytan/gstack / oneLine

Function oneLine

scripts/gen-llms-txt.ts:111–114  ·  view source on GitHub ↗

* Render a one-line summary from a multi-paragraph description: take the * first sentence (up to '.', '!', or '?') and trim. Keeps llms.txt scannable.

(text: string)

Source from the content-addressed store, hash-verified

109 * first sentence (up to '.', '!', or '?') and trim. Keeps llms.txt scannable.
110 */
111function oneLine(text: string): string {
112 const first = text.split(/(?<=[.!?])\s/)[0] ?? text;
113 return first.replace(/\s+/g, ' ').trim();
114}
115
116interface GenerateOptions {
117 /** Override repo root (for tests). */

Callers 1

generateLlmsTxtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected