node_modules/snyk/dist/cli/139.index.js
/**
 * Function for rendering checkbox choices
 * @param  {Number} pointer Position of the pointer
 * @return {String}         Rendered content
 */
Function for rendering checkbox choices
@param  {Number} pointer Position of the pointer
@return {String}         Rendered content
Function for rendering checkbox choices @param { Number } pointer Position of the pointer @return { String } Rendered content
function renderChoices(choices, pointer) {
  var output = '';
  var separatorOffset = 0;
  choices.forEach(function (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') + ')';
    } else {
      var line = getCheckbox(choice.checked) + ' ' + choice.name;
      if (i - separatorOffset === pointer) {
        output += chalk.cyan(figures.pointer + line);
      } else {
        output += ' ' + line;
      }
    }
    output += '\n';
  });
  return output.replace(/\n$/, '');
}
function renderChoices ( choices , pointer ) { var output = '' ; var separatorOffset = 0 ; choices . forEach ( function ( 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' ) + ')' ; } else { var line = getCheckbox ( choice . checked ) + ' ' + choice . name ; if ( i - separatorOffset === pointer ) { output += chalk . cyan ( figures . pointer + line ) ; } else { output += ' ' + line ; } } output += '\n' ; } ) ; return output . replace ( / \n$ / , '' ) ; }
Function for rendering checkbox choices
 @param  {Number} pointer Position of the pointer
 @return {String}         Rendered content
Function for rendering checkbox choices @param { Number } pointer Position of the pointer @return { String } Rendered content