<commit_before>const initialState = {
  commands: [
    { id: 0, text: 'Move' },
    { id: 1, text: 'Jump'},
    { id: 3, text: 'Speak' },
    { id: 4, text: 'Wave'},
    { id: 5, text: 'Sit' }
  ]
}

// constants
const ADD_COMMAND = 'ADD_COMMAND';

// action creaters
export const addCommand = (text) => ({
  type: ADD_COMMAND,
  text
})

// reducer
export default (state=initialState, action) => {
  const newState = Object.assign({}, state);

  switch (action.type) {
    case ADD_COMMAND:
      const command = {};
      // this id builder is faulty for when commands are deleted, but useful for testing front-end
      command.id = newState.commands.length;
      command.text = action.text;
      newState.commands.push(command);
      break;
  }

  return newState;
}<commit_msg>Added arrow and default case for reducer<commit_after>const initialState = {
  commands: [
    { id: 0, text: 'Move' },
    { id: 1, text: 'Jump'},
    { id: 3, text: 'Speak' },
    { id: 4, text: 'Wave'},
    { id: 5, text: 'Sit' }
  ]
}

// constants
const ADD_COMMAND = 'ADD_COMMAND';

// action creaters
export const addCommand = (text) => ({
  type: ADD_COMMAND,
  text
})

// reducer
export default (state=initialState, action) => {
  const newState = Object.assign({}, state);

  switch (action.type) {
    case ADD_COMMAND:
      const command = {};
      // this id builder is faulty for when commands are deleted, but useful for testing front-end
      command.id = newState.commands.length;
      command.text = action.text;
      newState.commands.push(command);
      break;
      
    default:
      return state;
  }

  return newState;
}
{'fraction_non_alphanumeric': 0.1415497254423429, 'fraction_numerical': 0.006101281269066504, 'mean_word_length': 2.7701149425287355, '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': '1649364', 'n_tokens_mistral': 551, 'n_tokens_neox': 537, 'n_words': 157}