mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-04 13:39:52 -06:00
17 lines
423 B
JavaScript
17 lines
423 B
JavaScript
const stripAnsi = require('strip-ansi')
|
|
|
|
const excessWhitespaceRe = /(\s{3,})/
|
|
const datesRe = /(\d+:\d+:\d+)/g
|
|
const downloadQueryRe = /(\?os=(mac|linux64|win)&arch=(x64|ia32))/
|
|
|
|
module.exports = (str) => {
|
|
// strip dates and ansi codes
|
|
// and excess whitespace
|
|
return stripAnsi(
|
|
str
|
|
.replace(datesRe, 'xx:xx:xx')
|
|
.replace(excessWhitespaceRe, ' ')
|
|
.replace(downloadQueryRe, '?os=OS&arch=ARCH')
|
|
)
|
|
}
|