index.js
function getLeastRecentlyUsed(mainDoc, lastUsedDoc) {
  var digestsToLastUsed = getDigestsToLastUsed(mainDoc, lastUsedDoc);

  var min;
  var minDigest;
  Object.keys(digestsToLastUsed).forEach(function (digest) {
    var lastUsed = digestsToLastUsed[digest];
    if (typeof min === 'undefined' || min > lastUsed) {
      min = lastUsed;
      minDigest = digest;
    }
  });
  return minDigest;
}
function getLeastRecentlyUsed(mainDoc, lastUsedDoc) {
  var digestsToLastUsed = getDigestsToLastUsed(mainDoc, lastUsedDoc);

  var min;
  var minDigest;
  Object.keys(digestsToLastUsed).forEach(function (digest) {
    var lastUsed = digestsToLastUsed[digest];
    if (typeof min === 'undefined' || min > lastUsed) {
      min = lastUsed;
      minDigest = digest;
    }
  });
  return minDigest;
}
function getLeastRecentlyUsed ( mainDoc , lastUsedDoc ) { var digestsToLastUsed = getDigestsToLastUsed ( mainDoc , lastUsedDoc ) ; var min ; var minDigest ; Object . keys ( digestsToLastUsed ) . forEach ( function ( digest ) { var lastUsed = digestsToLastUsed [ digest ] ; if ( typeof min === 'undefined' || min > lastUsed ) { min = lastUsed ; minDigest = digest ; } } ) ; return minDigest ; }
Get the digest that's the least recently used. If a digest was used
by more than one attachment, then favor the more recent usage date.
Get the digest that s the least recently used . If a digest was used by more than one attachment then favor the more recent usage date .