<commit_before>import _ from 'lodash'

export default {
  namespaced: true,
  state: {
    tasksOrder: [],
    tasks: {},
    nextID: 0
  },
  getters: {
    tasksAmount (state) {
      return Object.keys(state.tasks).length
    },
    orderedTasks (state) {
      return state.tasksOrder.map(id => state.tasks[id])
    }
  },
  mutations: {
    addTask (state, task) {
      const nextID = state.nextID
      state.nextID = nextID + 1

      state.tasks = { ...state.tasks, [nextID]: { ...task, id: nextID } }
      state.tasksOrder = [ ...state.tasksOrder, nextID ]
    },
    setTask (state, task) {
      state.tasks = { ...state.tasks, [task.id]: task }
    },
    removeTask (state, id) {
      state.tasks = _.omit(state.tasks, [id])
      state.tasksOrder = state.tasksOrder.filter(element => element !== id)
    }
  },
  actions: {
    addChecker ({ getters, commit }) {
      commit('addTask', { type: 'checker', identifier: '' })
    },
    addExecutor ({ getters, commit }) {
      commit('addTask', { type: 'executor', identifier: '', takes: {} })
    },
    setTaskIdentifier ({ commit }, { task, identifier }) {
      commit('setTask', { ...task, identifier: identifier })
    },
    updateTaskTakeValue ({ commit }, { task, takeName, value }) {
      commit('setTask', { ...task, takes: { ...task.takes, [takeName]: value } })
    }
  }
}
<commit_msg>Reset takes when changing identifier<commit_after>import _ from 'lodash'

export default {
  namespaced: true,
  state: {
    tasksOrder: [],
    tasks: {},
    nextID: 0
  },
  getters: {
    tasksAmount (state) {
      return Object.keys(state.tasks).length
    },
    orderedTasks (state) {
      return state.tasksOrder.map(id => state.tasks[id])
    }
  },
  mutations: {
    addTask (state, task) {
      const nextID = state.nextID
      state.nextID = nextID + 1

      state.tasks = { ...state.tasks, [nextID]: { ...task, id: nextID } }
      state.tasksOrder = [ ...state.tasksOrder, nextID ]
    },
    setTask (state, task) {
      state.tasks = { ...state.tasks, [task.id]: task }
    },
    removeTask (state, id) {
      state.tasks = _.omit(state.tasks, [id])
      state.tasksOrder = state.tasksOrder.filter(element => element !== id)
    }
  },
  actions: {
    addChecker ({ getters, commit }) {
      commit('addTask', { type: 'checker', identifier: '' })
    },
    addExecutor ({ getters, commit }) {
      commit('addTask', { type: 'executor', identifier: '', takes: {} })
    },
    setTaskIdentifier ({ commit }, { task, identifier }) {
      commit('setTask', { ...task, identifier: identifier, takes: [] })
    },
    updateTaskTakeValue ({ commit }, { task, takeName, value }) {
      commit('setTask', { ...task, takes: { ...task.takes, [takeName]: value } })
    }
  }
}

{'fraction_non_alphanumeric': 0.17702312138728324, 'fraction_numerical': 0.001445086705202312, 'mean_word_length': 2.4918032786885247, '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': '6698394', 'n_tokens_mistral': 897, 'n_tokens_neox': 886, 'n_words': 191}