MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / truncateText

Function truncateText

packages/codex-native-api/src/native_api_server.ts:2963–2968  ·  view source on GitHub ↗
(value: string, limit: number)

Source from the content-addressed store, hash-verified

2961}
2962
2963function truncateText(value: string, limit: number): string {
2964 if (value.length <= limit) {
2965 return value;
2966 }
2967 return `${value.slice(0, Math.max(0, limit - 3)).trimEnd()}...`;
2968}
2969
2970async function readJsonBody(request: IncomingMessage, maxBodyBytes: number): Promise<unknown> {
2971 const chunks: Buffer[] = [];

Callers 1

deriveRequestTitleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected