<commit_before>import Q = require('q');

export function ExecuteInSequence<T>(executables: (() => Q.Promise<T>)[]): Q.Promise<T[]> {
    let allResults: T[] = <T[]> [];

    return executables.reduce(
        (promise: Q.Promise<T>, nextTestPlan: () => Q.Promise<T>): Q.Promise<T> => {
            return promise.then((): Q.Promise<T> => {
                let result = nextTestPlan();

                return result.then((results) => {
                    allResults.push(results);
                    return results;
                });
            });
        }, Q.resolve(null))
        .then(() => {
            return allResults;
        });
}
<commit_msg>Cleaning up logic.<commit_after>import Q = require('q');

export function ExecuteInSequence<T>(executables: (() => Q.Promise<T>)[]): Q.Promise<T[]> {
    return executables.reduce((promise, executable) => {
        return promise.then((results) => {
            return executable().then((result) => {
                results.push(result);
                return results;
            });
        });
    }, Q.resolve([]));
}

{'fraction_non_alphanumeric': 0.18064516129032257, 'fraction_numerical': 0.0, 'mean_word_length': 2.0166666666666666, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 24, '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': '6627073', 'n_tokens_mistral': 317, 'n_tokens_neox': 307, 'n_words': 55}