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

Function readAnsiEscapeAt

src/replay/test/progress.ts:320–326  ·  view source on GitHub ↗
(value: string, index: number)

Source from the content-addressed store, hash-verified

318}
319
320function readAnsiEscapeAt(value: string, index: number): string | null {
321 if (!value.startsWith(ANSI_ESCAPE_PREFIX, index)) return null;
322 for (let cursor = index + ANSI_ESCAPE_PREFIX.length; cursor < value.length; cursor += 1) {
323 if (isAnsiFinalByte(value.charCodeAt(cursor))) return value.slice(index, cursor + 1);
324 }
325 return null;
326}
327
328function isAnsiFinalByte(code: number): boolean {
329 return code >= 0x40 && code <= 0x7e;

Callers 2

visibleLengthFunction · 0.85
sliceVisibleColumnsFunction · 0.85

Calls 2

isAnsiFinalByteFunction · 0.85
startsWithMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…