Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
...(genSeq(ansiEscapes.cursorTo, 0, 10)),
...(genSeq2(ansiEscapes.cursorTo, 0, 10, 0, 10)),
...(genSeq(ansiEscapes.cursorMove, -10, 10)),
...(genSeq2(ansiEscapes.cursorMove, -10, 10, -10, 10)),
...(genSeq(ansiEscapes.cursorUp, -10, 10)),
...(genSeq(ansiEscapes.cursorDown, -10, 10)),
...(genSeq(ansiEscapes.cursorForward, -10, 10)),
...(genSeq(ansiEscapes.cursorBackward, -10, 10)),
].map(e => `(${exports.escapeAnsiEscapeSeq(e)})`).join('|'), 'g')
exports.stripAnsiEscapeSeqs = (s) => s.replace(ansiEscapeSeqsReg, '')
const eraseLineEscapeSeqsReg = new RegExp([
ansiEscapes.eraseLine,
ansiEscapes.eraseStartLine,
ansiEscapes.eraseEndLine,
`${ESC}0K`,
...(genSeq(ansiEscapes.cursorTo, 0, 10)),
].map(e => `(${exports.escapeAnsiEscapeSeq(e)})`).join('|'), 'g')
exports.countEraseLineEscapeSeqs = (str) => {
return ((str || '').match(eraseLineEscapeSeqsReg) || []).length
}
function genSeq (fn, from, to) {
const result = []
for (let i = from; i <= to; i++) {
result.push(fn(i))
}
return result
}
process.nextTick(function() {
up();
write(ansi.eraseEndLine + '\r');
write(ansi.eraseEndLine + '\r\n');
var dobj = decycle(obj);
constructMeta(getType(dobj), 0, dobj);
renderMeta();
});
function backspace () {
if (input.length === 0) return
input = input.substr(0, input.length - 1)
stderr.write(ansi.cursorBackward(1))
stderr.write(ansi.eraseEndLine)
}
clearLine(dir, callback) {
assertCallback(callback);
switch (dir) {
case -1:
return this.write(ansiEscapes.eraseStartLine, callback);
case 1:
return this.write(ansiEscapes.eraseEndLine, callback);
default:
return this.write(ansiEscapes.eraseLine, callback);
}
},
var inverse = AnsiStyles.inverse;
var red = AnsiStyles.red;
var yellow = AnsiStyles.yellow;
var green = AnsiStyles.green;
var blue = AnsiStyles.blue;
var magenta = AnsiStyles.magenta;
var bgRed = AnsiStyles.bgRed;
var bgYellow = AnsiStyles.bgYellow;
var bgGreen = AnsiStyles.bgGreen;
var bgBlue = AnsiStyles.bgBlue;
var cursorUp = AnsiEscapes.cursorUp;
var cursorDown = AnsiEscapes.cursorDown;
var eraseEndLine = AnsiEscapes.eraseEndLine;
var cursorSavePosition = AnsiEscapes.cursorSavePosition;
var cursorRestorePosition = AnsiEscapes.cursorRestorePosition;
var width = 50;
var stdoutLineCount = 0;
var nyanTemplate = {
ascii: [
' ,--------, ',
' │▗▝ ▞ ▝ ˄---˄ ',
'~│ ▞ ▞ ❬.◕‿‿◕.❭',
' `w-w---- w w '
],
colors: [
' ggggggggggg ',
' gMMMMMMMggggg ',
process.nextTick(function() {
up();
write(ansi.eraseEndLine + '\r');
write(ansi.eraseEndLine + '\r\n');
var dobj = decycle(obj);
constructMeta(getType(dobj), 0, dobj);
renderMeta();
});
function backspace () {
if (input.length === 0) return
input = input.substr(0, input.length - 1)
stderr.write(ansi.cursorBackward(1))
stderr.write(ansi.eraseEndLine)
}
function backspace () {
if (input.length === 0) return
input = input.substr(0, input.length - 1)
stderr.write(ansi.cursorBackward(1))
stderr.write(ansi.eraseEndLine)
}