lib/detect.js
function (items) {
    if (items.length < 2) {
        return items;
    }

    var middle = Math.floor(items.length / 2);

    return merge(
        mergeSort(items.slice(0, middle)),
        mergeSort(items.slice(middle))
    );
}
function (items) {
    if (items.length < 2) {
        return items;
    }

    var middle = Math.floor(items.length / 2);

    return merge(
        mergeSort(items.slice(0, middle)),
        mergeSort(items.slice(middle))
    );
}
function ( items ) { if ( items . length < 2 ) { return items ; } var middle = Math . floor ( items . length / 2 ) ; return merge ( mergeSort ( items . slice ( 0 , middle ) ) , mergeSort ( items . slice ( middle ) ) ) ; }
Take an array and slice it in halves, sorting each half along the way.

@param  {array} items
@return {array} the sorted array
Take an array and slice it in halves sorting each half along the way .