MCPcopy Create free account
hub / github.com/modem-dev/hunk / stripAnsi

Function stripAnsi

src/ui/staticDiffPager.test.ts:4–6  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

2import { renderStaticDiffPager } from "./staticDiffPager";
3
4function stripAnsi(text: string) {
5 return text.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, "");
6}
7
8/** Remove Hunk's intentional SGR color codes while leaving unsafe controls visible. */
9function stripColorSgr(text: string) {

Callers 2

lineWithFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected