<commit_before><commit_msg>Router: running with custom options<commit_after>
import Eventhandler from '../libs/eventhandler';
import Router from '../libs/router';

/**
 * create
 * @param  {Object} config
 * @return {Router} router
 */
Router.create = function(config = {}){

	let $routerConfig = {
		config : {

			routes: config.routes,
			pushState: ::history.pushState,
			replaceState: ::history.replaceState,
			forward: ::history.forward,
			back: ::history.back,

			scope_root: Eventhandler.create({ element: config.scope_root || document && document.body || null }),
			event_root: config.event_root || 'click a',

			scope_popstate: Eventhandler.create({ element: config.scope_popstate || window}),
			event_popsate: config.event_popsate || 'popstate',

			scope_urlchange: Eventhandler.create({ element: config.scope_urlchange || window}),

			URLResolver: config.URLResolver || window.URL,
			encodeURI: config.encodeURI || window.encodeURI,
		},
	};

	// assign and return Instance of Router + config
	return new Router($routerConfig);

}

export default Router;
{'fraction_non_alphanumeric': 0.137546468401487, 'fraction_numerical': 0.0, 'mean_word_length': 4.523076923076923, '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': '2052225', 'n_tokens_mistral': 350, 'n_tokens_neox': 318, 'n_words': 78}