prod/service-worker-28ddbc7ef7a575da0539a0f05f4bfdae.js
function createFieldSorter(sort) {

  function getFieldValuesAsArray(doc) {
    return sort.map(function (sorting) {
      var fieldName = getKey(sorting);
      var parsedField = parseField(fieldName);
      var docFieldValue = getFieldFromDoc(doc, parsedField);
      return docFieldValue;
    });
  }

  return function (aRow, bRow) {
    var aFieldValues = getFieldValuesAsArray(aRow.doc);
    var bFieldValues = getFieldValuesAsArray(bRow.doc);
    var collation = collate(aFieldValues, bFieldValues);
    if (collation !== 0) {
      return collation;
    }
    // this is what mango seems to do
    return utils.compare(aRow.doc._id, bRow.doc._id);
  };
}
function createFieldSorter(sort) {

  function getFieldValuesAsArray(doc) {
    return sort.map(function (sorting) {
      var fieldName = getKey(sorting);
      var parsedField = parseField(fieldName);
      var docFieldValue = getFieldFromDoc(doc, parsedField);
      return docFieldValue;
    });
  }

  return function (aRow, bRow) {
    var aFieldValues = getFieldValuesAsArray(aRow.doc);
    var bFieldValues = getFieldValuesAsArray(bRow.doc);
    var collation = collate(aFieldValues, bFieldValues);
    if (collation !== 0) {
      return collation;
    }
    // this is what mango seems to do
    return utils.compare(aRow.doc._id, bRow.doc._id);
  };
}
function createFieldSorter ( sort ) { function getFieldValuesAsArray ( doc ) { return sort . map ( function ( sorting ) { var fieldName = getKey ( sorting ) ; var parsedField = parseField ( fieldName ) ; var docFieldValue = getFieldFromDoc ( doc , parsedField ) ; return docFieldValue ; } ) ; } return function ( aRow , bRow ) { var aFieldValues = getFieldValuesAsArray ( aRow . doc ) ; var bFieldValues = getFieldValuesAsArray ( bRow . doc ) ; var collation = collate ( aFieldValues , bFieldValues ) ; if ( collation !== 0 ) { return collation ; } // this is what mango seems to do return utils . compare ( aRow . doc . _id , bRow . doc . _id ) ; } ; }
create a comparator based on the sort object
create a comparator based on the sort object