<commit_before>module.exports = {
	OBJECT: function(value, option, options) {
		return value;
	},
	
	BOOLEAN: function(value, option, options) {
		if (value == null) {
			return value;
		}
		
		if (value.constructor === String) {
			value = (value.length === 0) ? null : (value === 'true');
		} else {
			value = (value === true);
		}
		return value;
	},
	
	STRING: function(value, option, options) {
		if (value == null) {
			return value;
		}
		value = value.toString();
		
		if (value.length === 0) {
			if (option.emptyNull) {
				return null;
			}
		} else {
			if (option.forceLowerCase) {
				value = value.toLowerCase();
			} else if (option.forceUpperCase) {
				value = value.toUpperCase();
			}
		}
		
		return value;
	},
	
	NUMBER: function(value, option, options) {
		if (value == null) {
			return value;
		}
		
		if (value.constructor === String) {
			return Number(value);
		} else if (value.constructor !== Number) {
			options.addError('Invalid number: ' + value, option, options);
		} else {
			return value;
		}
	},
	
	INTEGER: function(value, options, options) {
		if (value == null) {
			return value;
		}
		
		if (value.constructor === String) {
			return parseInt(value, 10);
		} else if (value.constructor !== Number) {
			options.addError('Invalid integer: ' + value, option, options);
		} else {
			return value;
		}
		
	}
};<commit_msg>added string checking to BOOLEAN parser<commit_after>module.exports = {
	OBJECT: function(value, option, options) {
		return value;
	},

	BOOLEAN: function(value, option, options) {
		if (value == null) {
			return value;
		}

		if (value.constructor === String) {
			value = value.toLowerCase();
			if (value === 'true') {
				value = true;
			} else if (value === 'false') {
				value = false;
			} else {
				options.addError('Invalid boolean: ' + value, option, options);
			}
		} else {
			value = (value === true);
		}
		return value;
	},

	STRING: function(value, option, options) {
		if (value == null) {
			return value;
		}
		value = value.toString();

		if (value.length === 0) {
			if (option.emptyNull) {
				return null;
			}
		} else {
			if (option.forceLowerCase) {
				value = value.toLowerCase();
			} else if (option.forceUpperCase) {
				value = value.toUpperCase();
			}
		}

		return value;
	},

	NUMBER: function(value, option, options) {
		if (value == null) {
			return value;
		}

		if (value.constructor === String) {
			return Number(value);
		} else if (value.constructor !== Number) {
			options.addError('Invalid number: ' + value, option, options);
		} else {
			return value;
		}
	},

	INTEGER: function(value, options, options) {
		if (value == null) {
			return value;
		}

		if (value.constructor === String) {
			return parseInt(value, 10);
		} else if (value.constructor !== Number) {
			options.addError('Invalid integer: ' + value, option, options);
		} else {
			return value;
		}

	}
};
{'fraction_non_alphanumeric': 0.15831316972001383, 'fraction_numerical': 0.0024196335983408227, 'mean_word_length': 2.921409214092141, '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': '4948840', 'n_tokens_mistral': 1142, 'n_tokens_neox': 957, 'n_words': 246}