<commit_before>import sendRequest from './sendRequest'
import merge from 'deepmerge'


const reserved = [
  'onError',
  'onResponse',
]

const isReserved = (key) => reserved.indexOf(key) >= 0
const isFn = (key) => typeof key == 'function'

const mergeOptions = (defaults, opt) => {
  const options = merge(defaults, opt)

  if ('params' in options) {
    for (const key in options) {
      if (!options.hasOwnProperty(key)) continue

      if (!isReserved(key) && isFn(options[key])) {
        options[key] = options[key](options.params)
      }
    }
  }

  return options
}


const createRequestAction = (defaults = {}) => {<commit_msg>fix passing empty params object to options fn in createAction merge method<commit_after>import sendRequest from './sendRequest'
import merge from 'deepmerge'


const reserved = [
  'onError',
  'onResponse',
]

const isReserved = (key) => reserved.indexOf(key) >= 0
const isFn = (key) => typeof key == 'function'

const mergeOptions = (defaults, opt) => {
  const options = merge(defaults, opt)

  for (const key in options) {
    if (!options.hasOwnProperty(key)) continue

    if (!isReserved(key) && isFn(options[key])) {
      options[key] = options[key](options.params || {})
    }
  }

  return options
}


const createRequestAction = (defaults = {}) => {
{'fraction_non_alphanumeric': 0.14461538461538462, 'fraction_numerical': 0.0015384615384615385, 'mean_word_length': 3.8185185185185184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4397931', 'n_tokens_mistral': 405, 'n_tokens_neox': 397, 'n_words': 113}