10 lines
237 B
Plaintext
10 lines
237 B
Plaintext
import ansiRegex from 'ansi-regex';
|
|
|
|
export default function stripAnsi(string) {
|
|
if (typeof string !== 'string') {
|
|
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
}
|
|
|
|
return string.replace(ansiRegex(), '');
|
|
}
|