<commit_before>app.services.dialog = {
  newDialog: function (message, type, callback) {
    //validation
    if (!message || message === '') {
      throw new Error('please provide a message string. Got: '+ message);
    }
    if (typeof(type) !== 'string'){
      throw new Error('second argument "type" must be a string. Got: ' + typeof(type));
    }
    if (!callback) {
      callback = function () {};
    }
    
    switch (type) {
      case 'confirm':
        vex.dialog.confirm({
          message: message,
          callback: callback
        });
        break;
      case 'error':
        window.console.error(message);
        vex.dialog.alert({
          message: message,
          className: 'vex-theme-default error'
        });
        break;
      default:
        if (type) {
          window.console.info('No case for provided type: "', type, '". Using default');
        }
        vex.dialog.alert({
          message: message,
          callback: callback
        });<commit_msg>fixes new dialog without specific type (defaults to empty string)<commit_after>app.services.dialog = {
  newDialog: function (message, type, callback) {
    //validation
    type = type || '';
    if (!message || message === '') {
      throw new Error('please provide a message string. Got: '+ message);
    }
    if (typeof(type) !== 'string'){
      throw new Error('second argument "type" must be a string. Got: ' + typeof(type));
    }
    if (!callback) {
      callback = function () {};
    }

    switch (type) {
      case 'confirm':
        vex.dialog.confirm({
          message: message,
          callback: callback
        });
        break;
      case 'error':
        window.console.error(message);
        vex.dialog.alert({
          message: message,
          className: 'vex-theme-default error'
        });
        break;
      default:
        if (type) {
          window.console.info('No case for provided type: "', type, '". Using default');
        }
        vex.dialog.alert({
          message: message,
          callback: callback
        });
{'fraction_non_alphanumeric': 0.13769860375541645, 'fraction_numerical': 0.0, 'mean_word_length': 1.9062937062937062, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6635551', 'n_tokens_mistral': 569, 'n_tokens_neox': 554, 'n_words': 157}