MCPcopy Create free account
hub / github.com/Effect-TS/effect / stripAnsi

Function stripAnsi

packages/effect/src/unstable/cli/CliOutput.ts:377–380  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

375 * @internal
376 */
377const stripAnsi = (text: string): string => {
378 // oxlint-disable-next-line no-control-regex
379 return text.replace(/\u001B\[[0-9;]*m/g, "")
380}
381
382/**
383 * Gets the visual length of a string (excluding ANSI codes).

Callers 1

visualLengthFunction · 0.70

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected