@lvksh/logger
Version:
Zero dependency, light-weight, blazing fast customizable logging library.
9 lines (8 loc) • 451 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripAnsi = void 0;
const ansi = new RegExp(
// eslint-disable-next-line no-control-regex
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))', 'g');
const stripAnsi = (input) => input.replace(ansi, '');
exports.stripAnsi = stripAnsi;