<commit_before>import createAction from 'dojo-actions/createAction';

import widgetStore from '../stores/widgetStore';
import {
	addTodo,
	deleteCompleted,
	deleteTodo,
	toggleAll,
	updateTodo
} from './todoStoreActions';

export const todoInput = createAction({
	do(options: any) {
		if (options.event.keyCode === 13 && options.event.target.value) {
			addTodo.do({label: options.event.target.value, completed: false});
			widgetStore.patch({id: 'new-todo', value: ''});
		}
	}
});

export const todoEdit = createAction({
	do(options: any) {
		widgetStore.patch(Object.assign(options, {editing: true}));
	}
});

export const todoEditInput = createAction({
	do(options: any) {
		if (options.event.keyCode === 13) {
			todoSave.do(options);
		}
		else if (options.event.keyCode === 27) {
			widgetStore.patch(Object.assign(options.state, {editing: false}));
		}
	}
});

export const todoSave = createAction({
	do(options: any) {
		const label = options.event.target.value;

		if (!label) {
			deleteTodo.do({id: options.state.id});
		}
		else {
			updateTodo.do(Object.assign(options.state, {label, editing: false}));
		}
	}
});

export const todoRemove = createAction({
	do(options: {id: string}) {
		deleteTodo.do(options);
	}
});

export const todoToggleComplete = createAction({
	do(options: any) {
		const item = Object.assign({}, options, { completed: !options.completed });
		updateTodo.do(item);
	}
});

export const filter = createAction({
	do(options: {filter: string}) {
		widgetStore.patch({id: 'todo-footer', activeFilter: options.filter});
		widgetStore.patch({id: 'todo-list', activeFilter: options.filter});
	}
});

export const todoToggleAll = createAction({
	do(options: any) {
		const checked = options.event.target.checked;
		toggleAll.do({checked});
	}
});

export const clearCompleted = createAction({
	do() {
		deleteCompleted.do();
	}
});
<commit_msg>todo-mvc: Don't use Object.assign directly<commit_after>import createAction from 'dojo-actions/createAction';
import { assign } from 'dojo-core/lang';

import widgetStore from '../stores/widgetStore';
import {
	addTodo,
	deleteCompleted,
	deleteTodo,
	toggleAll,
	updateTodo
} from './todoStoreActions';

export const todoInput = createAction({
	do(options: any) {
		if (options.event.keyCode === 13 && options.event.target.value) {
			addTodo.do({label: options.event.target.value, completed: false});
			widgetStore.patch({id: 'new-todo', value: ''});
		}
	}
});

export const todoEdit = createAction({
	do(options: any) {
		widgetStore.patch(assign(options, {editing: true}));
	}
});

export const todoEditInput = createAction({
	do(options: any) {
		if (options.event.keyCode === 13) {
			todoSave.do(options);
		}
		else if (options.event.keyCode === 27) {
			widgetStore.patch(assign(options.state, {editing: false}));
		}
	}
});

export const todoSave = createAction({
	do(options: any) {
		const label = options.event.target.value;

		if (!label) {
			deleteTodo.do({id: options.state.id});
		}
		else {
			updateTodo.do(assign(options.state, {label, editing: false}));
		}
	}
});

export const todoRemove = createAction({
	do(options: {id: string}) {
		deleteTodo.do(options);
	}
});

export const todoToggleComplete = createAction({
	do(options: any) {
		const item = assign({}, options, { completed: !options.completed });
		updateTodo.do(item);
	}
});

export const filter = createAction({
	do(options: {filter: string}) {
		widgetStore.patch({id: 'todo-footer', activeFilter: options.filter});
		widgetStore.patch({id: 'todo-list', activeFilter: options.filter});
	}
});

export const todoToggleAll = createAction({
	do(options: any) {
		const checked = options.event.target.checked;
		toggleAll.do({checked});
	}
});

export const clearCompleted = createAction({
	do() {
		deleteCompleted.do();
	}
});

{'fraction_non_alphanumeric': 0.16649076517150396, 'fraction_numerical': 0.0031662269129287598, 'mean_word_length': 4.616296296296296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3611837', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1278, 'n_words': 266}