<commit_before>import Notify from '../notify';
import utils from '../../utils/utils';
import locale from '../../locale';

const prefixCls = 'h-modal';

let Default = {
  middle: false
}

function Confirm(content, title) {
  return new Promise((resolve, reject) => {
    let param = {
      type: prefixCls,
      content: `<div><i class="h-icon-warn yellow-color" style="font-size:28px;vertical-align: -8px;"></i>&nbsp;&nbsp;${content}</div>`,
      buttons: ['cancel', 'ok'],
      events: {
        ok: (n) => {
          n.close();
          resolve()
        },
        cancel: (n) => {
          n.close();
          reject();
        }
      },
      title,
      class: 'h-modal-comfirm',
      hasMask: true,
      closeOnMask: true,
      hasCloseIcon: false,
      timeout: 0
    };
    param = utils.extend({}, Default, param, true);
    return Notify(param);
  });
}

function confirm(content, title) {
  if (!title) {
    title = locale.t('h.confirm.title');
  }
  return Confirm(content, title);
}

confirm.config = (options) => {
  if (options.middle) {
    Default.middle = true;
  }
};

export default confirm;
<commit_msg>fix(Confirm): remove reject apply for js error<commit_after>import Notify from '../notify';
import utils from '../../utils/utils';
import locale from '../../locale';

const prefixCls = 'h-modal';

let Default = {
  middle: false
}

function Confirm(content, title) {
  return new Promise((resolve) => {
    let param = {
      type: prefixCls,
      content: `<div><i class="h-icon-warn yellow-color" style="font-size:28px;vertical-align: -8px;"></i>&nbsp;&nbsp;${content}</div>`,
      buttons: ['cancel', 'ok'],
      events: {
        ok: (n) => {
          n.close();
          resolve()
        },
        cancel: (n) => {
          n.close();
        }
      },
      title,
      class: 'h-modal-comfirm',
      hasMask: true,
      closeOnMask: true,
      hasCloseIcon: false,
      timeout: 0
    };
    param = utils.extend({}, Default, param, true);
    return Notify(param);
  });
}

function confirm(content, title) {
  if (!title) {
    title = locale.t('h.confirm.title');
  }
  return Confirm(content, title);
}

confirm.config = (options) => {
  if (options.middle) {
    Default.middle = true;
  }
};

export default confirm;

{'fraction_non_alphanumeric': 0.17811816192560176, 'fraction_numerical': 0.00350109409190372, 'mean_word_length': 2.406855439642325, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '4526593', 'n_tokens_mistral': 742, 'n_tokens_neox': 743, 'n_words': 174}