lib/query/SortOrderComparator.js
function jsonCompare(arg, options) {
    var sortOrder;
    if (typeof arg === 'string') {
        sortOrder = new SortOrder_1.SortOrder();
        sortOrder.fromJSON([arg]);
    }
    else if (_.isArray(arg)) {
        sortOrder = new SortOrder_1.SortOrder();
        sortOrder.fromJSON(arg);
    }
    else {
        sortOrder = arg;
    }
    var comparator = new SortOrderComparator(sortOrder, options);
    return (_.bind(comparator.compare, comparator));
}
function jsonCompare(arg, options) {
    var sortOrder;
    if (typeof arg === 'string') {
        sortOrder = new SortOrder_1.SortOrder();
        sortOrder.fromJSON([arg]);
    }
    else if (_.isArray(arg)) {
        sortOrder = new SortOrder_1.SortOrder();
        sortOrder.fromJSON(arg);
    }
    else {
        sortOrder = arg;
    }
    var comparator = new SortOrderComparator(sortOrder, options);
    return (_.bind(comparator.compare, comparator));
}
function jsonCompare ( arg , options ) { var sortOrder ; if ( typeof arg === 'string' ) { sortOrder = new SortOrder_1 . SortOrder ( ) ; sortOrder . fromJSON ( [ arg ] ) ; } else if ( _ . isArray ( arg ) ) { sortOrder = new SortOrder_1 . SortOrder ( ) ; sortOrder . fromJSON ( arg ) ; } else { sortOrder = arg ; } var comparator = new SortOrderComparator ( sortOrder , options ) ; return ( _ . bind ( comparator . compare , comparator ) ) ; }
compiles a JsonCompareFn from a given SortOrder.

@param arg defining the SortOrder being compiled.
@return {function} a JsonCompareFn function compatible to Array.sort().
compiles a JsonCompareFn from a given SortOrder .