MCPcopy Create free account
hub / github.com/callstack/agent-device / visibleLength

Function visibleLength

src/replay/test/progress.ts:284–296  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

282}
283
284function visibleLength(value: string): number {
285 let length = 0;
286 for (let index = 0; index < value.length; ) {
287 const ansi = readAnsiEscapeAt(value, index);
288 if (ansi) {
289 index += ansi.length;
290 continue;
291 }
292 length += 1;
293 index += 1;
294 }
295 return length;
296}
297
298function hasAnsi(value: string): boolean {
299 return value.includes(ANSI_ESCAPE_PREFIX);

Callers 2

trimToColumnsFunction · 0.85

Calls 1

readAnsiEscapeAtFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…