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

Function truncate

apps/cloud/src/observability/index.ts:55–58  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

53};
54
55const truncate = (s: string): string =>
56 s.length <= MAX_CONSOLE_CAUSE_CHARS
57 ? s
58 : `${s.slice(0, MAX_CONSOLE_CAUSE_CHARS)}\n…[truncated ${s.length - MAX_CONSOLE_CAUSE_CHARS} chars]`;
59
60const validOtelContext = (context: OtelCorrelationContext): boolean =>
61 OTEL_TRACE_ID_PATTERN.test(context.traceId) && OTEL_SPAN_ID_PATTERN.test(context.spanId);

Callers 1

index.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected