linegauge/strip
Every export of linegauge/strip, with its signature and doc comment: strip, strip.
import strip from 'linegauge/strip';
import { strip } from 'linegauge/strip';Functions
default
The default export, declared as strip.
Everything a terminal would print, with the escape sequences removed: CSI (SGR and the
cursor and erase forms), OSC including OSC 8 hyperlinks under all three terminators, the
C1 introducers, and the single-character escapes. A lone ESC with nothing that parses
after it is text and is kept — the same answer strip-ansi gives, because it is the same
pattern. A string with neither ESC nor 0x9B is returned as it is, without a replace —
strip-ansi's own fast path, including what it leaves alone: a C1 OSC (0x9D) with no ESC
or 0x9B beside it is kept by the incumbent, and so it is kept here.
function strip(string: string): string;| Parameter | Type |
|---|---|
string | string |
Returns string
strip
Everything a terminal would print, with the escape sequences removed: CSI (SGR and the
cursor and erase forms), OSC including OSC 8 hyperlinks under all three terminators, the
C1 introducers, and the single-character escapes. A lone ESC with nothing that parses
after it is text and is kept — the same answer strip-ansi gives, because it is the same
pattern. A string with neither ESC nor 0x9B is returned as it is, without a replace —
strip-ansi's own fast path, including what it leaves alone: a C1 OSC (0x9D) with no ESC
or 0x9B beside it is kept by the incumbent, and so it is kept here.
function strip(string: string): string;| Parameter | Type |
|---|---|
string | string |
Returns string