<commit_before>let rules1 = new Array() ;
let rules2 = new Array() ;
let rules3 = new Array() ;

let corsEnabled = false ;

//Adds a rule
//protocols: 0 for HTTP only, 1 for HTTPS only, 2 either protocol
//host: host that this applys to
//	If host is an array, it recursivaly calls itself with each host
//pathYes: RegExp that path must match
//pathNo: RegExp that path must NOT match
//	The path has to match pathYes and not match pathNo for this rule to be taken into account
//	If either pathNo is null, it will be ignored and 'nothing' will match it
//allowAllOrigins: Bool, if true, all origins will be allowed
//allowedOrigings: Array of origins that can access the resource
//	Can be string or regexp
//allowedMethods: array of allowed HTTP methods
function addRule(protocols, host, pathYes, pathNo, allowAllOrigins, allowOrigins, allowMethods, allowHeaders=[], exposeHeaders=[], allowCredentials=false, priority=0, maxAge=0) {
	if (typeof protocols !== "number" || protocols > 2 || protocols < 0) {
		throw new Error("protocols must be a Number that is 0, 1 or 2") ;
	}
	if (typeof pathYes !== "object" || pathYes.constructor !== RegExp) {
		if (typeof pathYes === "string") {
			pathYes = new RegExp(pathYes, "g") ;
		} else {
			throw new Error("pathYes must be a RegExp or String") ;
		}
	}
	if (pathNo !== null && (typeof pathNo !== "object" || pathNo.constructor !== RegExp)) {
		if (typeof pathNo === "string") {
			pathNo = new RegExp(pathNo, "g") ;
		} else {
			throw new Error("pathNo must be a RegExp, String or null") ;
		}
	}
	if (typeof allowAllOrigins !== "boolean") {
		throw new Error("allowAllOrigins must be a Boolean") ;
	}
	if (typeof allowOrigins !== "object" || allowOrigins.constructor !== Array) {
		throw new Error("allowOrigins must be an Array") ;
	}
	if (typeof allowMethods !== "object" || allowMethods.constructor !== Array) {
		throw new Error("allowMethods must be an Array") ;
	}
	if (typeof allowHeaders !== "object" || allowHeaders.constructor !== Array) {
		throw new Error("allowHeaders must be an Array") ;
	}
	if (typeof exposeHeaders !== "object" || exposeHeaders.constructor !== Array) {
		throw new Error("exposeHeaders must be an Array") ;
	}
	if (typeof allowCredentials !== "boolean") {
		throw new Error("allowCredentials must be a Boolean") ;
	}
	if (typeof priority !== "number" || priority < -1 || priority > 1) {
		throw new Error("priority must be a Number that is -1, 0 or 1") ;
	}
	if (typeof maxAge !== "number") {
		throw new Error("maxAge must be a Number") ;
	}
	if (typeof host === "object" && host.constructor !== Array) {
		for (let doing in host) {
			addRule(protocols, host[doing], pathYes, pathNo, allowOrigins, allowMethods, allowHeaders, exposeHeaders, allowCredentials)
		}
		return ;
	} else if (typeof host !== "string") {
		throw new Error("host must be a String or Array of Strings.") ;
	}
	let allowOriginsRegExp = new Array() ;
	for (let doing in allowOrigins) {
		if (allowOrigins[doing].constructor === RegExp) {
			allowOriginsRegExp.push(allowOrigins.splice(parseInt(doing), 1)) ;<commit_msg>Checks now use constructor name because extensions are in a differnt context and thus the contructor is a different Array function then our Array function, same for RegExp<commit_after>let rules1 = new Array() ;
let rules2 = new Array() ;
let rules3 = new Array() ;

let corsEnabled = false ;

//Adds a rule
//protocols: 0 for HTTP only, 1 for HTTPS only, 2 either protocol
//host: host that this applys to
//	If host is an array, it recursivaly calls itself with each host
//pathYes: RegExp that path must match
//pathNo: RegExp that path must NOT match
//	The path has to match pathYes and not match pathNo for this rule to be taken into account
//	If either pathNo is null, it will be ignored and 'nothing' will match it
//allowAllOrigins: Bool, if true, all origins will be allowed
//allowedOrigings: Array of origins that can access the resource
//	Can be string or regexp
//allowedMethods: array of allowed HTTP methods
function addRule(protocols, host, pathYes, pathNo, allowAllOrigins, allowOrigins, allowMethods, allowHeaders=[], exposeHeaders=[], allowCredentials=false, priority=0, maxAge=0) {
	if (typeof protocols !== "number" || protocols > 2 || protocols < 0) {
		throw new Error("protocols must be a Number that is 0, 1 or 2") ;
	}
	if (typeof pathYes !== "object" || pathYes.constructor.name !== "RegExp") {
		if (typeof pathYes === "string") {
			pathYes = new RegExp(pathYes, "g") ;
		} else {
			throw new Error("pathYes must be a RegExp or String") ;
		}
	}
	if (pathNo !== null && (typeof pathNo !== "object" || pathNo.constructor.name !== "RegExp")) {
		if (typeof pathNo === "string") {
			pathNo = new RegExp(pathNo, "g") ;
		} else {
			throw new Error("pathNo must be a RegExp, String or null") ;
		}
	}
	if (typeof allowAllOrigins !== "boolean") {
		throw new Error("allowAllOrigins must be a Boolean") ;
	}
	if (typeof allowOrigins !== "object" || allowOrigins.constructor.name !== "Array") {
		throw new Error("allowOrigins must be an Array") ;
	}
	if (typeof allowMethods !== "object" || allowMethods.constructor.name !== "Array") {
		throw new Error("allowMethods must be an Array") ;
	}
	if (typeof allowHeaders !== "object" || allowHeaders.constructor.name !== "Array") {
		throw new Error("allowHeaders must be an Array") ;
	}
	if (typeof exposeHeaders !== "object" || exposeHeaders.constructor.name !== "Array") {
		throw new Error("exposeHeaders must be an Array") ;
	}
	if (typeof allowCredentials !== "boolean") {
		throw new Error("allowCredentials must be a Boolean") ;
	}
	if (typeof priority !== "number" || priority < -1 || priority > 1) {
		throw new Error("priority must be a Number that is -1, 0 or 1") ;
	}
	if (typeof maxAge !== "number") {
		throw new Error("maxAge must be a Number") ;
	}
	if (typeof host === "object" && host.constructor !== Array) {
		for (let doing in host) {
			addRule(protocols, host[doing], pathYes, pathNo, allowOrigins, allowMethods, allowHeaders, exposeHeaders, allowCredentials)
		}
		return ;
	} else if (typeof host !== "string") {
		throw new Error("host must be a String or Array of Strings.") ;
	}
	let allowOriginsRegExp = new Array() ;
	for (let doing in allowOrigins) {
		if (allowOrigins[doing].constructor === RegExp) {
			allowOriginsRegExp.push(allowOrigins.splice(parseInt(doing), 1)) ;
{'fraction_non_alphanumeric': 0.12948395217117684, 'fraction_numerical': 0.005978602894902455, 'mean_word_length': 4.168292682926829, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5942727', 'n_tokens_mistral': 2046, 'n_tokens_neox': 1945, 'n_words': 755}