code: 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));
  }
docs: compiles a JsonCompareFn from a given SortOrder.
  
  @param arg defining the SortOrder being compiled.
  @return {function} a JsonCompareFn function compatible to Array.sort().