MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / truncate

Function truncate

apps/cloud/src/observability/error-logging.ts:6–11  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

4const MAX_LOGGED_CAUSE_CHARS = 4_000;
5
6const truncate = (value: string): string =>
7 value.length <= MAX_LOGGED_CAUSE_CHARS
8 ? value
9 : `${value.slice(0, MAX_LOGGED_CAUSE_CHARS)}\n...[truncated ${
10 value.length - MAX_LOGGED_CAUSE_CHARS
11 } chars]`;
12
13const loggedCause = (cause: Cause.Cause<unknown>): string => truncate(Cause.pretty(cause));
14

Callers 1

loggedCauseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected