prod/service-worker-28ddbc7ef7a575da0539a0f05f4bfdae.js
function computeHeight(revs) {
  var height = {};
  var edges = [];
  pouchdbMerge.traverseRevTree(revs, function (isLeaf, pos, id, prnt) {
    var rev = pos + "-" + id;
    if (isLeaf) {
      height[rev] = 0;
    }
    if (prnt !== undefined) {
      edges.push({from: prnt, to: rev});
    }
    return rev;
  });

  edges.reverse();
  edges.forEach(function (edge) {
    if (height[edge.from] === undefined) {
      height[edge.from] = 1 + height[edge.to];
    } else {
      height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);
    }
  });
  return height;
}
function computeHeight(revs) {
  var height = {};
  var edges = [];
  pouchdbMerge.traverseRevTree(revs, function (isLeaf, pos, id, prnt) {
    var rev = pos + "-" + id;
    if (isLeaf) {
      height[rev] = 0;
    }
    if (prnt !== undefined) {
      edges.push({from: prnt, to: rev});
    }
    return rev;
  });

  edges.reverse();
  edges.forEach(function (edge) {
    if (height[edge.from] === undefined) {
      height[edge.from] = 1 + height[edge.to];
    } else {
      height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]);
    }
  });
  return height;
}
function computeHeight ( revs ) { var height = { } ; var edges = [ ] ; pouchdbMerge . traverseRevTree ( revs , function ( isLeaf , pos , id , prnt ) { var rev = pos + "-" + id ; if ( isLeaf ) { height [ rev ] = 0 ; } if ( prnt !== undefined ) { edges . push ( { from : prnt , to : rev } ) ; } return rev ; } ) ; edges . reverse ( ) ; edges . forEach ( function ( edge ) { if ( height [ edge . from ] === undefined ) { height [ edge . from ] = 1 + height [ edge . to ] ; } else { height [ edge . from ] = Math . min ( height [ edge . from ] , 1 + height [ edge . to ] ) ; } } ) ; return height ; }
for every node in a revision tree computes its distance from the closest leaf
for every node in a revision tree computes its distance from the closest leaf