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

Method render

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

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

(error)

Source from the content-addressed store, hash-verified

105835 */
105836
105837 render(error) {
105838 // Render question
105839 var message = this.getQuestion();
105840 var bottomContent = '';
105841
105842 if (this.status === 'answered') {
105843 message += chalk.cyan(this.answer);
105844 } else {
105845 var choicesStr = renderChoices(this.opt.choices, this.selected);
105846 message += this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
105847 message += '\n Answer: ';
105848 }
105849
105850 message += this.rl.line;
105851
105852 if (error) {
105853 bottomContent = '\n' + chalk.red('>> ') + error;
105854 }
105855
105856 this.screen.render(message, bottomContent);
105857 }
105858
105859 /**
105860 * When user press `enter` key

Callers 4

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

Calls 4

renderChoicesFunction · 0.85
getQuestionMethod · 0.80
paginateMethod · 0.80
renderMethod · 0.45

Tested by

no test coverage detected