codeql-action/node_modules/ava/node_modules/strip-ansi/index.js
2022-02-01 18:56:42 +00:00

9 lines
237 B
JavaScript

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(), '');
}