function normalizeList(previousList, fullNormalization) {
	let newList = new List(previousList.id, previousList.name, previousList.createdAt, previousList.currentTaskIndex);
	if (fullNormalization) {
		previousList.tasks.forEach((task) => {
			let newTask = new Task(task.id, task.caption, task.completed, task.order);
			newList.tasks.push(newTask);
		});
	}
	return newList;
}
/**
 * Normalizes retrieved lists from database by creating new ones.
 * @function normalizeList
 * @param {{id: string, name: string, createdAt: Date, order: number, currentTaskIndex: number, tasks: Array}} previousList
 * @param {boolean} fullNormalization Indicator to normalize list completely (with tasks) or partially (without tasks)
 * @returns {Object}
 */
Normalizes retrieved lists from database by creating new ones.
Normalizes retrieved lists from database by creating new ones .
function normalizeList(previousList, fullNormalization) {
	let newList = new List(previousList.id, previousList.name, previousList.createdAt, previousList.currentTaskIndex);
	if (fullNormalization) {
		previousList.tasks.forEach((task) => {
			let newTask = new Task(task.id, task.caption, task.completed, task.order);
			newList.tasks.push(newTask);
		});
	}
	return newList;
}
function normalizeList ( previousList , fullNormalization ) { let newList = new List ( previousList . id , previousList . name , previousList . createdAt , previousList . currentTaskIndex ) ; if ( fullNormalization ) { previousList . tasks . forEach ( ( task ) => { let newTask = new Task ( task . id , task . caption , task . completed , task . order ) ; newList . tasks . push ( newTask ) ; } ) ; } return newList ; }
Normalizes retrieved lists from database by creating new ones.
Normalizes retrieved lists from database by creating new ones .