prettytable.js
function ( a, b) {
        if (typeof reverse === 'boolean' && reverse === true) {
            if (a[colindex] < b[colindex]) {
                return 1;
            }
            else if (a[colindex] > b[colindex]) {
                return -1;
            }
            else {
                return 0;
            }
        }
        else {
            if (a[colindex] < b[colindex]) {
                return -1;
            }
            else if (a[colindex] > b[colindex]) {
                return 1;
            }
            else {
                return 0;
            }
        }
    }
function ( a, b) {
        if (typeof reverse === 'boolean' && reverse === true) {
            if (a[colindex] < b[colindex]) {
                return 1;
            }
            else if (a[colindex] > b[colindex]) {
                return -1;
            }
            else {
                return 0;
            }
        }
        else {
            if (a[colindex] < b[colindex]) {
                return -1;
            }
            else if (a[colindex] > b[colindex]) {
                return 1;
            }
            else {
                return 0;
            }
        }
    }
function ( a , b ) { if ( typeof reverse === 'boolean' && reverse === true ) { if ( a [ colindex ] < b [ colindex ] ) { return 1 ; } else if ( a [ colindex ] > b [ colindex ] ) { return - 1 ; } else { return 0 ; } } else { if ( a [ colindex ] < b [ colindex ] ) { return - 1 ; } else if ( a [ colindex ] > b [ colindex ] ) { return 1 ; } else { return 0 ; } } }
Comparator method which takes the column index and sort direction
Comparator method which takes the column index and sort direction