lib/helpers/question_asker.js
function askConfirmation(args) {
  let userAnswer = 'no-answer';
  const merged = merge(DEFAULTS.CONFIRMATIONS, args);
  inquirer.prompt([
    {
      type: DEFAULTS.QUESTION_TYPES.CONFIRM,
      name: 'choice',
      message: merged.question,
      default: merged.defaultValue
    }
  ]).then((answer) => {
    userAnswer = answer.choice;
  });
  while (userAnswer === 'no-answer') {
    wait(100);
  }
  return userAnswer;
}
function askConfirmation(args) {
  let userAnswer = 'no-answer';
  const merged = merge(DEFAULTS.CONFIRMATIONS, args);
  inquirer.prompt([
    {
      type: DEFAULTS.QUESTION_TYPES.CONFIRM,
      name: 'choice',
      message: merged.question,
      default: merged.defaultValue
    }
  ]).then((answer) => {
    userAnswer = answer.choice;
  });
  while (userAnswer === 'no-answer') {
    wait(100);
  }
  return userAnswer;
}
function askConfirmation ( args ) { let userAnswer = 'no-answer' ; const merged = merge ( DEFAULTS . CONFIRMATIONS , args ) ; inquirer . prompt ( [ { type : DEFAULTS . QUESTION_TYPES . CONFIRM , name : 'choice' , message : merged . question , default : merged . defaultValue } ] ) . then ( ( answer ) => { userAnswer = answer . choice ; } ) ; while ( userAnswer === 'no-answer' ) { wait ( 100 ) ; } return userAnswer ; }
Asks the user for confirmation.
@param args {object} keys: question, defaultValue
@return {boolean} the user's answer.
Asks the user for confirmation .