prod/service-worker-28ddbc7ef7a575da0539a0f05f4bfdae.js
function sortFieldsByIndex(userFields, index) {
  var indexFields = index.def.fields.map(getKey);

  return userFields.slice().sort(function (a, b) {
    var aIdx = indexFields.indexOf(a);
    var bIdx = indexFields.indexOf(b);
    if (aIdx === -1) {
      aIdx = Number.MAX_VALUE;
    }
    if (bIdx === -1) {
      bIdx = Number.MAX_VALUE;
    }
    return utils.compare(aIdx, bIdx);
  });
}
function sortFieldsByIndex(userFields, index) {
  var indexFields = index.def.fields.map(getKey);

  return userFields.slice().sort(function (a, b) {
    var aIdx = indexFields.indexOf(a);
    var bIdx = indexFields.indexOf(b);
    if (aIdx === -1) {
      aIdx = Number.MAX_VALUE;
    }
    if (bIdx === -1) {
      bIdx = Number.MAX_VALUE;
    }
    return utils.compare(aIdx, bIdx);
  });
}
function sortFieldsByIndex ( userFields , index ) { var indexFields = index . def . fields . map ( getKey ) ; return userFields . slice ( ) . sort ( function ( a , b ) { var aIdx = indexFields . indexOf ( a ) ; var bIdx = indexFields . indexOf ( b ) ; if ( aIdx === - 1 ) { aIdx = Number . MAX_VALUE ; } if ( bIdx === - 1 ) { bIdx = Number . MAX_VALUE ; } return utils . compare ( aIdx , bIdx ) ; } ) ; }
sort the user fields by their position in the index, if they're in the index
sort the user fields by their position in the index if they re in the index