@@ -28,6 +28,7 @@ Wrap a string
2828 - [ ` LinePadding ` ] ( #linepadding )
2929 - [ ` LinesInfo ` ] ( #linesinfo )
3030 - [ ` Options ` ] ( #options )
31+ - [ ` StripAnsi ` ] ( #stripansi )
3132 - [ ` ToString<[T]> ` ] ( #tostringt )
3233- [ Contribute] ( #contribute )
3334
@@ -195,13 +196,15 @@ Options for wrapping a string (`interface`).
195196 setting this to ` true ` will break long words.
196197 > 👉 **note**: setting this to ` true ` will break words.
197198- ` indent ? ` ( ` number ` | ` string ` | ` null ` | ` undefined ` , optional)
198- — the size of the indent, or a string used to indent each line
199+ — the size of the string to use for indenting each line (as a number or numeric), or the string itself
199200- ` padLeft ? ` ( ` number ` | ` string ` | ` null ` | ` undefined ` , optional)
200- — the size of the string to use for padding the left side of each line (as a number or numeric), or the string to use
201+ — the size of the string to use for padding the left side of each line (as a number or numeric), or the string itself
201202- ` padRight ? ` ( ` number ` | ` string ` | ` null ` | ` undefined ` , optional)
202- — the size of the string to use for padding the right side of each line (as a number or numeric), or the string to use
203+ — the size of the string to use for padding the right side of each line (as a number or numeric), or the string itself
203204- ` stringify ? ` ([ ` ToString ` ](#tostringt) | ` null ` | ` undefined ` , optional)
204205 — convert a value to a string
206+ - ` stripAnsi ? ` ([ ` StripAnsi ` ](#stripansi) | ` boolean ` | ` null ` | ` undefined ` , optional)
207+ — whether to remove ANSI escape codes before wrapping, or a function to remove ANSI escape codes
205208- ` tabSize ? ` ( ` number ` | ` null ` | ` undefined ` , optional)
206209 — the number of spaces a tab is equivalent to
207210 - default: ` 2 `
@@ -210,6 +213,23 @@ Options for wrapping a string (`interface`).
210213 > 👉 **note**: lines are trimmed before applying indents or padding.
211214 - default: ` true `
212215
216+ ### ` StripAnsi `
217+
218+ Remove ANSI escape codes from a string ( ` type ` ).
219+
220+ ` ` ` ts
221+ type StripAnsi = (this : void , string : string ) => string
222+ ` ` `
223+
224+ #### Parameters
225+
226+ - ` string ` ( ` string ` )
227+ — the string containing ANSI escape codes
228+
229+ #### Returns
230+
231+ ( ` string ` ) The string with ANSI escape codes removed
232+
213233### ` ToString <[T ]>`
214234
215235Convert ` value ` to a string ( ` type ` ).
0 commit comments