MCPcopy Create free account
hub / github.com/cortexkit/magic-context / clip

Function clip

packages/plugin/src/shared/error-message.ts:41–44  ·  view source on GitHub ↗
(value: string, max: number)

Source from the content-addressed store, hash-verified

39}
40
41function clip(value: string, max: number): string {
42 if (value.length <= max) return value;
43 return `${value.slice(0, max)}…`;
44}
45
46export function describeError(error: unknown): ErrorDescription {
47 const stringForm = clip(safeString(error), 400);

Callers 1

describeErrorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected