atcheck/lsscanner/new_ubuntu/node_modules/npm/lib/utils/ansi-trim.js

8 lines
211 B
JavaScript
Raw Normal View History

2019-12-16 18:42:21 +01:00
function ansiTrim (str) {
var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' +
'\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g')
return str.replace(r, '')
}
module.exports = ansiTrim