MCPcopy
hub / github.com/codeceptjs/CodeceptJS / ansiRegExp

Function ansiRegExp

lib/utils.js:434–438  ·  view source on GitHub ↗
({ onlyFirst = false } = {})

Source from the content-addressed store, hash-verified

432}
433
434export const ansiRegExp = function ({ onlyFirst = false } = {}) {
435 const pattern = ['[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|')
436
437 return new RegExp(pattern, onlyFirst ? undefined : 'g')
438}
439
440export const tryOrDefault = function (fn, defaultValue) {
441 try {

Callers 1

serializeErrorFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected