<commit_before>"use strict";

exports = module.exports = whenthen;

function noop () {}

function whenthen (when) {
	if (!when) { when = noop; }

	var queue = [],
		results,
		state = 'waiting';

	function done () {
		state = 'ready';
		results = arguments;
		completeQueue();
	}

	function completeQueue () {
		while (queue.length > 0) {
			queue.shift().apply(null, results);
		}
	}

	function add (done) {
		queue.push(done);
		if (state === 'waiting') {
			state = 'running';
			when(done);
		} else if (state == 'ready') {
			completeQueue();
		}
	}

	return {
		do: add,
		resolve: done
	};
}<commit_msg>fixed name conflict which broke the whole thing<commit_after>"use strict";

exports = module.exports = whenthen;

function noop () {}

function whenthen (when) {
	if (!when) { when = noop; }

	var queue = [],
		results,
		state = 'waiting';

	function resolve () {
		state = 'ready';
		results = arguments;
		completeQueue();
	}

	function completeQueue () {
		while (queue.length > 0) {
			queue.shift().apply(null, results);
		}
	}

	function add (task) {
		queue.push(task);
		if (state === 'waiting') {
			state = 'running';
			when(resolve);
		} else if (state == 'ready') {
			completeQueue();
		}
	}

	return {
		do: add,
		resolve: resolve
	};
}
{'fraction_non_alphanumeric': 0.16785431512272367, 'fraction_numerical': 0.001583531274742676, 'mean_word_length': 3.185430463576159, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1125855', 'n_tokens_mistral': 496, 'n_tokens_neox': 436, 'n_words': 113}