<commit_before>//-------------------------------------------
// kafe.url
//-------------------------------------------
kafe.bonify({name:'url', version:'1.0', obj:(function($,K,undefined){

	// _parseIt (string, type)
	// parse url
	//-------------------------------------------
	function _parseIt(str,type) {
		switch (type) {
			case 'params': {
				var data  = {};
				var pairs = str.split('&');
				for (var i in pairs) {
					var e = pairs[i].split('=');
					data[e[0]] = decodeURI(e[1]);
				}
				return data;
			}
			
			case 'path': {
				return str.split('/');
			}
		}
	}

	//-------------------------------------------
	// PUBLIC
	//-------------------------------------------
	var url = {};

	// parseSearchParams ([url])
	// parse search as param=value
	//-------------------------------------------
	url.parseSearchParams = function(s) {
		s = (s) ? s : window.location.search;
		return _parseIt(s.substring(1), 'params');
	};

	// parseSearchPath ([url])
	// parse search as a path
	//-------------------------------------------
	url.parseSearchPath = function(s) {
		s = (s) ? s : window.location.search;
		return (s.substring(1,2) == '/') ? _parseIt(s.substring(2), 'path') : [];
	};
	
	// parseHashParams ([url])<commit_msg>CHG - Correction louche pour ie8<commit_after>//-------------------------------------------
// kafe.url
//-------------------------------------------
kafe.bonify({name:'url', version:'1.0', obj:(function($,K,undefined){

	// _parseIt (string, type)
	// parse url
	//-------------------------------------------
	function _parseIt(str,type) {
		switch (type) {
			case 'params': 
				var data  = {};
				var pairs = str.split('&');
				for (var i in pairs) {
					var e = pairs[i].toString().split('=');
					data[e[0]] = decodeURI(e[1]);
				}
				return data;
			break;
			
			case 'path':
				return str.split('/');
			break;
		}
	}

	//-------------------------------------------
	// PUBLIC
	//-------------------------------------------
	var url = {};

	// parseSearchParams ([url])
	// parse search as param=value
	//-------------------------------------------
	url.parseSearchParams = function(s) {
		s = (s) ? s : window.location.search;
		return _parseIt(s.substring(1), 'params');
	};

	// parseSearchPath ([url])
	// parse search as a path
	//-------------------------------------------
	url.parseSearchPath = function(s) {
		s = (s) ? s : window.location.search;
		return (s.substring(1,2) == '/') ? _parseIt(s.substring(2), 'path') : [];
	};
	
	// parseHashParams ([url])
{'fraction_non_alphanumeric': 0.3988919667590028, 'fraction_numerical': 0.006727344677483181, 'mean_word_length': 1.2391496899911425, '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': '1587157', 'n_tokens_mistral': 853, 'n_tokens_neox': 741, 'n_words': 153}