MCPcopy
hub / github.com/opentrace/opentrace / cleanLabel

Function cleanLabel

ui/src/components/pixi/PixiRenderer.ts:74–79  ·  view source on GitHub ↗

Strip control characters and truncate to MAX_LABEL_LENGTH.

(raw: string)

Source from the content-addressed store, hash-verified

72
73/** Strip control characters and truncate to MAX_LABEL_LENGTH. */
74function cleanLabel(raw: string): string {
75 const stripped = raw.replace(/[\n\r\t]+/g, ' ').trim();
76 return stripped.length > LABEL_MAX_LENGTH
77 ? stripped.slice(0, LABEL_MAX_LENGTH) + '…'
78 : stripped;
79}
80
81// ─── Types ──────────────────────────────────────────────────────────────
82

Callers 2

applyLabelCullingMethod · 0.70
createLabelMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected