lib/api-sync.js
function formatUpdates(processedUpdates) {
  var updates = {
    hashes: {}
  };
  _.each(processedUpdates, function(update) {
    var type = update.type;
    var hash = update.hash;
    updates.hashes[hash] = update;
    updates[type] = updates[type] || {};
    updates[type][hash] = update;
  });
  return updates;
}
function formatUpdates(processedUpdates) {
  var updates = {
    hashes: {}
  };
  _.each(processedUpdates, function(update) {
    var type = update.type;
    var hash = update.hash;
    updates.hashes[hash] = update;
    updates[type] = updates[type] || {};
    updates[type][hash] = update;
  });
  return updates;
}
function formatUpdates ( processedUpdates ) { var updates = { hashes : { } } ; _ . each ( processedUpdates , function ( update ) { var type = update . type ; var hash = update . hash ; updates . hashes [ hash ] = update ; updates [ type ] = updates [ type ] || { } ; updates [ type ] [ hash ] = update ; } ) ; return updates ; }
Reformat the give processedUpdates array to an object format that is expected by the sync client
@param {Array} processedUpdates the array of updates to process
@returns {Object} an object that contains the updates with different types
Reformat the give processedUpdates array to an object format that is expected by the sync client