<commit_before>/**
* Temporary place to hold some utility functions
* which should be used througout Raptor JS
*
* This will need to be refactored
*/

if(typeof raptor === 'undefined') {
	var raptor = {};
}

(function () {
	
	// Let's prototyp the indexOf for arrays
	if(typeof Array.indexOf !== 'function') {
		
		Array.prototype.indexOf = function (needle) {
			var length = this.length;
			
			for(var i=0; i<length; i++) {
				if(this[i] === needle) return i;
			}
			
			return -1;
		}
	}
	
})();<commit_msg>now returns an object<commit_after>/**
* Temporary place to hold some utility functions
* which should be used througout Raptor JS
*
* This will need to be refactored
*/

if(typeof raptor === 'undefined') {
	var raptor = {};
}

raptor.util = (function () {
	
	// Let's prototyp the indexOf for arrays
	if(typeof Array.indexOf !== 'function') {
		
		Array.prototype.indexOf = function (needle) {
			var length = this.length;
			
			for(var i=0; i<length; i++) {
				if(this[i] === needle) return i;
			}
			
			return -1;
		}
	}
	
	return {
		
		/**
		 * Tests for data type by constructor name
		 * 
		 * @param {Array} types
		 * @param {Array|Boolean|Date|Math|Number|String|RegExp} data
		 */
		type : function(types, data) {
			for (var i = 0; i < types.length; i++) {
				if (data.constructor.toString().indexOf(types[i]) !== -1) return true;
			}
			return false;
		}	
	}
})();
{'fraction_non_alphanumeric': 0.15257879656160458, 'fraction_numerical': 0.004297994269340974, 'mean_word_length': 2.96875, 'pattern_counts': {'":': 0, '<': 6, '<?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': '6230155', 'n_tokens_mistral': 556, 'n_tokens_neox': 467, 'n_words': 139}