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

Function stripAnsi

packages/cli/src/cloud/ansi.ts:19–21  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

17const ANSI_SGR_RE = new RegExp("\\u001b\\[[\\d;]*m", "g");
18
19export function stripAnsi(s: string): string {
20 return s.replace(ANSI_SGR_RE, "");
21}
22
23/** Length of `s` after ANSI SGR codes are stripped. */
24export function visibleLength(s: string): number {

Callers 2

visibleLengthFunction · 0.85
ansi.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected