MCPcopy
hub / github.com/Kong/insomnia / render

Method render

packages/insomnia/bin/yarn-standalone.js:105696–105715  ·  view source on GitHub ↗

* Render the prompt to screen * @return {PasswordPrompt} self

(error)

Source from the content-addressed store, hash-verified

105694 */
105695
105696 render(error) {
105697 var message = this.getQuestion();
105698 var bottomContent = '';
105699
105700 if (this.status === 'answered') {
105701 message += this.opt.mask
105702 ? chalk.cyan(mask(this.answer, this.opt.mask))
105703 : chalk.italic.dim('[hidden]');
105704 } else if (this.opt.mask) {
105705 message += mask(this.rl.line || '', this.opt.mask);
105706 } else {
105707 message += chalk.italic.dim('[input is hidden] ');
105708 }
105709
105710 if (error) {
105711 bottomContent = '\n' + chalk.red('>> ') + error;
105712 }
105713
105714 this.screen.render(message, bottomContent);
105715 }
105716
105717 /**
105718 * When user press `enter` key

Callers 4

_runMethod · 0.95
onEndMethod · 0.95
onErrorMethod · 0.95
onKeypressMethod · 0.95

Calls 3

maskFunction · 0.85
getQuestionMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected