index.js
function diffVersions(callback) {
        var prior = null;
        _.each(versions, function(version) {
          if (!prior) {
            version.diff = [ { value: '[NEW]', added: true } ];
          } else {
            version.diff = apos.diffPages(prior, version);
          }
          prior = version;
        });
        versions.reverse();
        return callback(null);
      }
function diffVersions(callback) {
        var prior = null;
        _.each(versions, function(version) {
          if (!prior) {
            version.diff = [ { value: '[NEW]', added: true } ];
          } else {
            version.diff = apos.diffPages(prior, version);
          }
          prior = version;
        });
        versions.reverse();
        return callback(null);
      }
function diffVersions ( callback ) { var prior = null ; _ . each ( versions , function ( version ) { if ( ! prior ) { version . diff = [ { value : '[NEW]' , added : true } ] ; } else { version . diff = apos . diffPages ( prior , version ) ; } prior = version ; } ) ; versions . reverse ( ) ; return callback ( null ) ; }
We must diff on the fly because versions get pruned over time
We must diff on the fly because versions get pruned over time