MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / stripColors

Function stripColors

common/src/util/string.ts:377–379  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

375
376const ansiColorsRegex = /\x1B\[[0-9;]*m/g
377export function stripColors(str: string): string {
378 return str.replace(ansiColorsRegex, '')
379}
380
381const ansiRegex = /\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x1B]*\x1B\\?)/g
382export function stripAnsi(str: string): string {

Callers 1

runTerminalCommandFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected