<commit_before>export const SHOW_ALERT = 'SHOW_ALERT';
export const HIDE_ALERT = 'HIDE_ALERT';

export const updateAlert = config => {
  const defaults = {
    type: HIDE_ALERT,
    payload: {
      status: 'normal',
      visible: false,
      msg: 'No message provided.'
    }
  }

  return { ...defaults, ...config }
}

export const generateAlertPayload = (status, msg) => {
  return {
    type: SHOW_ALERT,
    payload: {
      visible: true,
      status,
      msg
    }
  }
}<commit_msg>used underscore for recursive merging<commit_after>import _ from 'lodash'

export const SHOW_ALERT = 'SHOW_ALERT';
export const HIDE_ALERT = 'HIDE_ALERT';

export const updateAlert = config => {
  const defaults = {
    type: HIDE_ALERT,
    payload: {
      status: 'normal',
      visible: false,
      msg: 'No message provided.'
    }
  }

  return _.merge(defaults, config)
}

export const generateAlertPayload = (status, msg) => {
  return {
    type: SHOW_ALERT,
    payload: {
      visible: true,
      status,
      msg
    }
  }
}
{'fraction_non_alphanumeric': 0.11497584541062802, 'fraction_numerical': 0.0, 'mean_word_length': 2.635087719298246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4094674', 'n_tokens_mistral': 350, 'n_tokens_neox': 343, 'n_words': 89}