Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let prompt = [
ui.symbol(this.done, this.aborted),
this.msg,
ui.delimiter(this.completing),
this.done && this.suggestions[this.cursor]
? this.suggestions[this.cursor].title
: this.transform(this.input)
].join(' ')
if (!this.done) {
prompt += esc.cursorSavePosition
for (let i = 0; i < this.suggestions.length; i++) {
const s = this.suggestions[i]
prompt += '\n' + (i === this.cursor ? chalk.cyan(s.title) : s.title)
}
prompt += esc.cursorRestorePosition
}
this.out.write(ui.clear(this.lastRendered) + prompt)
this.lastRendered = prompt
}
}
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 ',
'ggMMMMMMgwwwwwwg',
' gggggggggggg '