All files main.js

100% Statements 4/4
100% Branches 8/8
100% Functions 2/2
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13  4x 1x         3x 4x        
export default function createObjectMapReducer(initialState, handlers, ...initialArgs) {
  if (typeof handlers !== 'object') {
    throw new TypeError(
      `[reducer-generator-object-map]: received an invalid "handlers" argument.  Expected object but got ${typeof handlers}`,
    );
  }
 
  return (state = initialState, action, ...reducerArgs) =>
    !action || !action.type || typeof handlers[action.type] !== 'function'
      ? state
      : handlers[action.type](state, action, ...initialArgs, ...reducerArgs);
}