<commit_before>module.exports = function HawkejsRouter(Hawkejs, Blast) {

	var Router = Hawkejs.Helper.extend(function RouterHelper(view) {
		Hawkejs.Helper.call(this, view);
	});

	/**
	 * Return route name info
	 *
	 * @author   <NAME>   <<EMAIL>>
	 * @since    0.2.0
	 * @version  0.3.0
	 *
	 * @param    {String}   name
	 * @param    {Boolean}  socket_route   Look in the socket routes
	 *
	 * @return   {Object}
	 */
	Router.setMethod(function routeConfig(name, socket_route) {

		var section,
		    pieces,
		    routes,
		    result,
		    name,
		    key;

		if (socket_route) {
			routes = this.view.expose('socket_routes');

			if (!routes && Blast.isNode) {
				routes = global.Router.getSocketRoutes();
			}
		} else {

			routes = this.view.expose('routes');

			if (!routes && Blast.isNode) {
				routes = global.Router.getRoutes();
			}
		}

		pieces = name.split('@');
		config = {};

		if (pieces.length == 1) {
			name = pieces[0];

			// Always look in the default section first
			if (routes.default[name] != null) {
				section = 'default';
			} else {
				for (key in routes) {
					if (routes[key][name] != null) {
						section = key
					}
				}<commit_msg>RouterHelper fix so it can be used without a view<commit_after>module.exports = function HawkejsRouter(Hawkejs, Blast) {

	var Router = Hawkejs.Helper.extend(function RouterHelper(view) {
		Hawkejs.Helper.call(this, view);
	});

	/**
	 * Return route name info
	 *
	 * @author   <NAME>   <<EMAIL>>
	 * @since    0.2.0
	 * @version  0.3.0
	 *
	 * @param    {String}   name
	 * @param    {Boolean}  socket_route   Look in the socket routes
	 *
	 * @return   {Object}
	 */
	Router.setMethod(function routeConfig(name, socket_route) {

		var section,
		    pieces,
		    routes,
		    result,
		    name,
		    key;

		if (socket_route) {

			if (this.view) {
				routes = this.view.expose('socket_routes');
			}

			if (!routes && Blast.isNode) {
				routes = global.Router.getSocketRoutes();
			}
		} else {

			if (this.view) {
				routes = this.view.expose('routes');
			}

			if (!routes && Blast.isNode) {
				routes = global.Router.getRoutes();
			}
		}

		pieces = name.split('@');
		config = {};

		if (pieces.length == 1) {
			name = pieces[0];

			// Always look in the default section first
			if (routes.default[name] != null) {
				section = 'default';
			} else {
				for (key in routes) {
					if (routes[key][name] != null) {
						section = key
					}
				}
{'fraction_non_alphanumeric': 0.1483897268650632, 'fraction_numerical': 0.006522625356706074, 'mean_word_length': 2.471004243281471, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '497940', 'n_tokens_mistral': 1030, 'n_tokens_neox': 855, 'n_words': 195}