Move get url to self referential function
This commit is contained in:
		| @@ -102,7 +102,19 @@ const getURLVars = () => { | ||||
| } | ||||
|  | ||||
| module.exports = { | ||||
| 	url: getURLVars(), | ||||
| 	url: (() => { | ||||
| 		var v = {}; | ||||
| 		if (location.search.length > 0) { | ||||
| 			var qs = (location.search.substr(1)).split("&"); | ||||
| 			for (var i = 0; i < qs.length; i++) { | ||||
| 				var t = qs[i].split("="); | ||||
| 				if (t[1].length > 0) { | ||||
| 					v[t[0]] = decodeURIComponent(t[1].replace(/\+/g, '%20')); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		return v; | ||||
| 	})(), | ||||
| 	cookie: {	 | ||||
| 		set: (name, value, expires, path, domain, secure) => { | ||||
| 			switch(typeof expires) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user