(str: string)
| 31 | * Useful for testing stringified output that may contain color codes. |
| 32 | */ |
| 33 | export function stripAnsiEscapeCodes(str: string): string { |
| 34 | // eslint-disable-next-line no-control-regex |
| 35 | return str.replace(/\x1b\[[0-9;]*m/g, ""); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Dumps steps as a string with ANSI codes stripped. |