Example #1
0
List.prototype._findFile = function (path, pattern) {
  if (!path || !pattern) return
  if (!this.buckets.has(pattern.pattern)) return

  return _.find(from(this.buckets.get(pattern.pattern)), function (file) {
    return file.originalPath === path
  })
}
Example #2
0
/**
 * Updates the running queue for the associated auction.
 * Does a check to ensure the auction is still running; if it's not - the previously running queue is killed.
 * @param {*} auctionInstance running context of the auction
 * @param {Object} bidResponse bid object being added to queue
 * @param {Function} afterBidAdded callback function used when Prebid Cache responds
 */
function updateBidQueue(auctionInstance, bidResponse, afterBidAdded) {
  let bidListIter = bidCacheRegistry.getBids(bidResponse);

  if (bidListIter) {
    let bidListArr = from(bidListIter);
    let callDispatcher = bidCacheRegistry.getQueueDispatcher(bidResponse);
    let killQueue = !!(auctionInstance.getAuctionStatus() !== AUCTION_IN_PROGRESS);
    callDispatcher(auctionInstance, bidListArr, afterBidAdded, killQueue);
  } else {
    utils.logWarn('Attempted to cache a bid from an unknown auction. Bid:', bidResponse);
  }
}
 .map(function (p) {
   return from(self.buckets.get(p.pattern)).sort(byPath)
 })
Example #4
0
function findFile (path, files) {
  return from(files).find((file) => file.path === path)
}
Example #5
0
function pathsFrom (files) {
  return _.pluck(from(files), 'path')
}
Example #6
0
var findByPath = function (files, path) {
  return _.find(from(files), function (file) {
    return file.path === path
  })
}
Example #7
0
 var expandPattern = function (p) {
   return from(self.buckets.get(p.pattern) || []).sort(byPath)
 }