<commit_before>var Tools = module.exports = {};

Tools.route = function(resource,route) {
	var str = '/' + resource + '/';
	if (route && route.params) {
		for(var param in route.params) {
			str+=':'+param+'/';
		}
	}
	return str;
};

Tools.mock = function(resource,route) {
	var str = '/' + resource + '/';
	if (route && route.params) {
		for(var param in route.params) {
			str+=fake(route.params[param]) + '/';
		}
	}
	return str;	
};

var fake = function(param) {
	var val = '';
	switch (param.type) {
		case 'int64': val=1; break;
		default: val = 'hi'; break;
	}
	return val;
};<commit_msg>Heimdall method switcher added<commit_after>var edda = (function(){
	"use strict"

	var Tools = {};

	Tools.method = function(route) {
		var hasParams = false;
		if (route.params) {
			for(var i in route.params) {
				if(route.params.hasOwnProperty(i)) {
					hasParams = true;
					break;
				}
			}
		}

		var verb = 'COLLECTION';

		switch (route.name.toLowerCase()) {
			case 'get' : verb = hasParams?'ENTRY':'COLLECTION'; break;
			case 'post': verb = 'ADD'; break;
			case 'put' : verb = 'SAVE'; break;
			case 'delete': verb = 'REMOVE'; break;
			case 'entry': verb = 'ENTRY'; break;
			case 'collection': verb = 'COLLECTION'; break;
			case 'add': verb = 'ADD'; break;
			case 'save': verb = 'SAVE'; break;
			case 'remove': verb = 'REMOVE'; break;
			default: verb = 'COLLECTION'; break;
		}
		return verb;
	};

	Tools.route = function(resource,route) {
		var str = '/' + resource + '/';
		if (route && route.params) {
			for(var param in route.params) {
				str+=':'+param+'/';
			}
		}
		return str;
	};

	Tools.mock = function(resource,route) {
		var str = '/' + resource + '/';
		if (route && route.params) {
			for(var param in route.params) {
				str+=fake(route.params[param]) + '/';
			}
		}
		return str;	
	};

	var fake = function(param) {
		var val = '';
		switch (param.type) {
			case 'int64': val=1; break;
			default: val = 'hi'; break;
		}
		return val;
	};

	return Tools;
})();

if(typeof module !== "undefined" && module.exports) {
  //Node
  module.exports = edda;
} else if (typeof window!=="undefined") {
  //Browser
  window.edda = edda;
}
{'fraction_non_alphanumeric': 0.18966312874942318, 'fraction_numerical': 0.0027688047992616522, 'mean_word_length': 3.090566037735849, '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': '5839891', 'n_tokens_mistral': 880, 'n_tokens_neox': 786, 'n_words': 194}