node_modules/inquirer/lib/prompts/list.js
/**
 * Function for rendering list choices
 * @param  {Number} pointer Position of the pointer
 * @return {String}         Rendered content
 */
Function for rendering list choices
@param  {Number} pointer Position of the pointer
@return {String}         Rendered content
Function for rendering list choices @param { Number } pointer Position of the pointer @return { String } Rendered content
function listRender(choices, pointer) {
  var output = '';
  var separatorOffset = 0;
  choices.forEach((choice, i) => {
    if (choice.type === 'separator') {
      separatorOffset++;
      output += '  ' + choice + '\n';
      return;
    }
    if (choice.disabled) {
      separatorOffset++;
      output += '  - ' + choice.name;
      output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')';
      output += '\n';
      return;
    }
    var isSelected = i - separatorOffset === pointer;
    var line = (isSelected ? figures.pointer + ' ' : '  ') + choice.name;
    if (isSelected) {
      line = chalk.cyan(line);
    }
    output += line + ' \n';
  });
  return output.replace(/\n$/, '');
}
function listRender ( choices , pointer ) { var output = '' ; var separatorOffset = 0 ; choices . forEach ( ( choice , i ) => { if ( choice . type === 'separator' ) { separatorOffset ++ ; output += '  ' + choice + '\n' ; return ; } if ( choice . disabled ) { separatorOffset ++ ; output += '  - ' + choice . name ; output += ' (' + ( _ . isString ( choice . disabled ) ? choice . disabled : 'Disabled' ) + ')' ; output += '\n' ; return ; } var isSelected = i - separatorOffset === pointer ; var line = ( isSelected ? figures . pointer + ' ' : '  ' ) + choice . name ; if ( isSelected ) { line = chalk . cyan ( line ) ; } output += line + ' \n' ; } ) ; return output . replace ( / \n$ / , '' ) ; }
Function for rendering list choices
 @param  {Number} pointer Position of the pointer
 @return {String}         Rendered content
Function for rendering list choices @param { Number } pointer Position of the pointer @return { String } Rendered content