MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / truncateTelemetryString

Function truncateTelemetryString

packages/core/src/telemetryRedaction.ts:3–6  ·  view source on GitHub ↗
(value: string, maxLength: number)

Source from the content-addressed store, hash-verified

1const MAX_TELEMETRY_STRING_LENGTH = 240;
2
3function truncateTelemetryString(value: string, maxLength: number): string {
4 if (value.length <= maxLength) return value;
5 return `${value.slice(0, maxLength - 1)}…`;
6}
7
8function redactUrlQueryStrings(value: string): string {
9 return value.replace(/\b(https?:\/\/[^\s?]+)\?[^\s]*/g, "$1?…");

Callers 1

redactTelemetryStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected