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

Function truncate

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

Source from the content-addressed store, hash-verified

36};
37
38const truncate = (s: string): string =>
39 s.length <= MAX_CONSOLE_CAUSE_CHARS
40 ? s
41 : `${s.slice(0, MAX_CONSOLE_CAUSE_CHARS)}\n…[truncated ${s.length - MAX_CONSOLE_CAUSE_CHARS} chars]`;
42
43const validOtelContext = (context: OtelCorrelationContext): boolean =>
44 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