<commit_before>export function updateItem(oldObject = {}, newValues) {
  return { ...oldObject, ...newValues };
}

export function updateItemsInObject(obj = {}, items) {
  return items.reduce((acc, item) => ({
    ...acc,
    [item.id]: updateItem(obj[item.id], item)
  }), {});
}

export function createReducer(initialState, handlers) {
  return function reducer(state = initialState, action) {
    if (action.type in handlers) {
      return handlers[action.type](state, action);
    }
    return state;
  };
}
<commit_msg>Update reducers<commit_after>export function updateItem(oldObject = {}, newValues) {
  return { ...oldObject, ...newValues };
}

export function updateItemsInObject(obj = {}, items, key = 'id') {
  return items.reduce((acc, item) => ({
    ...acc,
    [item[key]]: updateItem(obj[item[key]], item)
  }), {});
}

export function createReducer(initialState, handlers) {
  return function reducer(state = initialState, action) {
    if (action.type in handlers) {
      return handlers[action.type](state, action);
    }
    return state;
  };
}

{'fraction_non_alphanumeric': 0.16292134831460675, 'fraction_numerical': 0.0, 'mean_word_length': 3.83710407239819, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3594760', 'n_tokens_mistral': 337, 'n_tokens_neox': 328, 'n_words': 75}