MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / truncate

Function truncate

src/core/hooks.ts:379–382  ·  view source on GitHub ↗
(text: string, max: number)

Source from the content-addressed store, hash-verified

377}
378
379function truncate(text: string, max: number): string {
380 const oneLine = text.replace(/\s+/g, " ").trim()
381 return oneLine.length <= max ? oneLine : oneLine.slice(0, max - 1) + "…"
382}
383
384interface RawHookOutput {
385 stdout: string

Callers 1

runOneMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected