<commit_before>import URI, {URIError, isDNSDomain, parseMailbox} from "https://cdn.jsdelivr.net/gh/wizard04wsu/URI_Parsing@jsfiddle-demo/src/uri_parsing.js"

console.clear();

document.getElementById("parse_scheme").addEventListener("click", ()=>{
	let val = document.getElementById("uri").value;
	console.group("scheme");
	console.log(val);
	try{
		val = URI(val);
		console.log(val.toString());
		console.log(val);
	}catch(e){
		if(e instanceof URIError) console.error(e.message);
		else throw e;
	}finally{
		console.groupEnd();
	}
}, false);

document.getElementById("parse_generic").addEventListener("click", ()=>{
	let val = document.getElementById("uri").value;
	console.group("generic");
	console.log(val);
	try{
		val = URI.parse(val)
		console.log(val.toString());
		console.log(val);
	}catch(e){
		if(e instanceof URIError) console.error(e.message);
		else throw e;
	}finally{
		console.groupEnd();
	}
}, false);

document.getElementById("parse_mailbox").addEventListener("click", ()=>{
	let val = document.getElementById("email").value;
	console.group("email");
	console.log(val);
	try{
		val = parseMailbox(val);
		console.log(val.full);
		console.log(val);
	}catch(e){
		if(e instanceof URIError) console.log(e.message);
		else throw e;
	}finally{
		console.groupEnd();
	}
}, false);<commit_msg>update jsfiddle demo<commit_after>import URI, {URIError, isDNSDomain, parseMailbox} from "https://cdn.jsdelivr.net/gh/wizard04wsu/URI_Parsing@jsfiddle-demo/src/uri_parsing.js"

console.clear();

document.getElementById("parse_scheme").addEventListener("click", ()=>{
	let val = document.getElementById("uri").value;
	console.group("scheme");
	try{
		let obj = URI(val);
		console.log("--> "+obj.toString());
		console.log(obj);
	}catch(e){
		if(e instanceof URIError) console.error(e.message);
		else throw e;
	}finally{
		console.groupEnd();
	}
}, false);

document.getElementById("parse_generic").addEventListener("click", ()=>{
	let val = document.getElementById("uri").value;
	console.group("generic");
	try{
		let obj = URI.parse(val)
		console.log("--> "+obj.toString());
		console.log(obj);
	}catch(e){
		if(e instanceof URIError) console.error(e.message);
		else throw e;
	}finally{
		console.groupEnd();
	}
}, false);

document.getElementById("parse_mailbox").addEventListener("click", ()=>{
	let val = document.getElementById("email").value;
	console.group("email");
	try{
		let obj = parseMailbox(val);
		console.log("--> "+obj.toString());
		console.log(obj);
	}catch(e){
		if(e instanceof URIError) console.log(e.message);
		else throw e;
	}finally{
		console.groupEnd();
	}
}, false);
{'fraction_non_alphanumeric': 0.18795550441120062, 'fraction_numerical': 0.0015343306482546988, 'mean_word_length': 5.487562189054726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 2, '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': '2298758', 'n_tokens_mistral': 940, 'n_tokens_neox': 895, 'n_words': 152}