<commit_before>/*!
 * sort-algorithms-js
 * mergeSort
 * Copyright(c) 2015 <NAME> <<EMAIL>>
 * MIT Licensed
 */

'use strict';

var getMiddle = require('./helpers/getMiddle');

module.exports = function(numbersArray) {

    var merge = function(leftPartition, rightPartition) {

            var mergePartitions = function(merged, leftPartition, rightPartition) {
                if (leftPartition.length === 0) {
                    return merged.concat(rightPartition);
                }
                if (rightPartition.length === 0) {
                    return merged.concat(leftPartition);
                }
                if (leftPartition[0] < rightPartition[0]) {
                    merged.push(leftPartition.shift());
                }
                else {
                    merged.push(rightPartition.shift());
                }
                return mergePartitions(merged, leftPartition, rightPartition);
            };

            return mergePartitions([], leftPartition, rightPartition);
        },

        partitionAndMerge = function(arr, startIndex, endIndex) {

            var middleIndex = getMiddle(startIndex, endIndex),
                leftPartition,<commit_msg>fix spacces<commit_after>/*!
 * sort-algorithms-js
 * mergeSort
 * Copyright(c) 2015 <NAME> <<EMAIL>>
 * MIT Licensed
 */

'use strict';

var getMiddle = require('./helpers/getMiddle');

module.exports = function(numbersArray) {

    var merge = function(leftPartition, rightPartition) {
        
            var mergePartitions = function(merged, leftPartition, rightPartition) {
                    if (leftPartition.length === 0) {
                        return merged.concat(rightPartition);
                    }
                    if (rightPartition.length === 0) {
                        return merged.concat(leftPartition);
                    }
                    if (leftPartition[0] < rightPartition[0]) {
                        merged.push(leftPartition.shift());
                    }
                    else {
                        merged.push(rightPartition.shift());
                    }
                    return mergePartitions(merged, leftPartition, rightPartition);
                };

            return mergePartitions([], leftPartition, rightPartition);
        },

        partitionAndMerge = function(arr, startIndex, endIndex) {

            var middleIndex = getMiddle(startIndex, endIndex),
                leftPartition,
{'fraction_non_alphanumeric': 0.10342019543973942, 'fraction_numerical': 0.006514657980456026, 'mean_word_length': 1.7, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2527660', 'n_tokens_mistral': 616, 'n_tokens_neox': 554, 'n_words': 116}