e2ed
Version:
E2E testing framework over Playwright
11 lines (10 loc) • 446 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeStyleFromString = void 0;
// eslint-disable-next-line no-control-regex
const stylesRegexp = /((\\x1B\[)|(\x1B\[)|(\\u001b\[)|(\u001b\[))[\d;]*m/gi;
/**
* Removes console (terminal) styles from a string (like `\x1B[3m...`).
*/
const removeStyleFromString = (text) => text.replace(stylesRegexp, '');
exports.removeStyleFromString = removeStyleFromString;