<commit_before>const ifNotFunction = e => !typeof e === 'function';

const testLogger = (log = {}) => {
	if (ifNotFunction(log.pushModified) || ifNotFunction(log.pushFail)) {
		throw new Error('Is not a valid logger. It need the methods pushModified and pushFail.');
	}
	return log;
};

class DatabaseTaskTemplate {
	constructor({
		id,
		_id,
		$set,
		set,
		$unset,
		unset,
		isModified = true,
		log,
	}) {
		this.id = _id || id;
		this.set = $set || set || {};
		this.unset = $unset || unset || {};
		this.isModified = isModified;

		this.log = testLogger(log);
	}

	setLog(log) {
		this.log = testLogger(log);
	}

	getId() {
		return { _id: this.id };
	}

	get() {
		const req = {};
		if (Object.keys(this.set).length > 0) {
			req.$set = this.set;
		}
		if (Object.keys(this.unset).length > 0) {<commit_msg>more stable solution for validate logger<commit_after>const ifNotFunction = e => !typeof e === 'function';

const testLogger = (log = {}) => {
	if (ifNotFunction(log.pushModified) || ifNotFunction(log.pushFail)) {
		throw new Error('Is not a valid logger. It need the methods pushModified and pushFail.');
	}
	return log;
};

class DatabaseTaskTemplate {
	constructor({
		id,
		_id,
		$set,
		set,
		$unset,
		unset,
		isModified = true,
		log,
	}) {
		this.id = _id || id;
		this.set = $set || set || {};
		this.unset = $unset || unset || {};
		this.isModified = isModified;

		this.log = log;
	}

	setLog(log) {
		this.log = log;
	}

	getId() {
		return { _id: this.id };
	}

	get() {
		const req = {};
		if (Object.keys(this.set).length > 0) {
			req.$set = this.set;
		}
		if (Object.keys(this.unset).length > 0) {
{'fraction_non_alphanumeric': 0.17391304347826086, 'fraction_numerical': 0.002449479485609308, 'mean_word_length': 3.1472081218274113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6602253', 'n_tokens_mistral': 668, 'n_tokens_neox': 619, 'n_words': 147}