<commit_before>import { match } from './route-matcher';
import { isSameRoute, START } from './route';
import RouteHandler from './route-handler';
import runQueue from './async-queue';
import { getHooks } from './global-hooks';

export default class History {
	constructor() {
		this.support = history && history.pushState;
		this.current = START;
	}

	/**
	 * Shared logic between route records and route handlers
	 *
	 * @param {Object|RouteHandler} obj
	 * @param {Array} beforeQueue
	 * @param {Array} queue
	 * @returns {Object|RouteHandler}
	 */
	addToQueue(obj, beforeQueue, queue) {
		if (obj.processed) {
			if (obj.beforeUpdate) {
				beforeQueue.push(obj.beforeUpdate);
			}

			if (obj.update) {
				queue.push(obj.update);
			}
		} else {
			if (obj.beforeInit) {
				beforeQueue.push(obj.beforeInit);
			}

			if (obj.init) {
				queue.push(obj.init);
			}
		}

		obj.processed = true;

		return obj;
	}

	/**
	 * Build out callback queues for processing
	 *
	 * @param {Object} records
	 * 	@param {Array} records.updated
	 * 	@param {Array} records.activated
	 * 	@param {Array} records.deactivated
	 * @param {Object} handlers
	 * 	@param {Array} handlers.updated
	 * 	@param {Array} handlers.activated
	 * 	@param {Array} handlers.deactivated
	 * @returns {Object}
	 */
	buildQueues(records, handlers) {<commit_msg>Remove unused function from History<commit_after>import { match } from './route-matcher';
import { isSameRoute, START } from './route';
import RouteHandler from './route-handler';
import runQueue from './async-queue';
import { getHooks } from './global-hooks';

export default class History {
	constructor() {
		this.support = history && history.pushState;
		this.current = START;
	}

	/**
	 * Build out callback queues for processing
	 *
	 * @param {Object} records
	 * 	@param {Array} records.updated
	 * 	@param {Array} records.activated
	 * 	@param {Array} records.deactivated
	 * @param {Object} handlers
	 * 	@param {Array} handlers.updated
	 * 	@param {Array} handlers.activated
	 * 	@param {Array} handlers.deactivated
	 * @returns {Object}
	 */
	buildQueues(records, handlers) {
{'fraction_non_alphanumeric': 0.13874469089193014, 'fraction_numerical': 0.0, 'mean_word_length': 3.5396145610278373, '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': '3918104', 'n_tokens_mistral': 752, 'n_tokens_neox': 652, 'n_words': 175}