Skip to content

Commit

Permalink
drop specific code for index adapter (#1487)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Kendall authored and dbemiller committed Aug 15, 2017
1 parent 311721a commit d3cd291
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/bidmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,18 @@ function getBidders(bid) {
function bidsBackAdUnit(adUnitCode) {
const requested = $$PREBID_GLOBAL$$._bidsRequested
.map(request => request.bids
.filter(adUnitsFilter.bind(this, $$PREBID_GLOBAL$$._adUnitCodes))
.filter(bid => bid.placementCode === adUnitCode))
.reduce(flatten, [])
.map(bid => {
return bid.bidder === 'indexExchange'
? bid.sizes.length
: 1;
}).reduce(add, 0);
.reduce(flatten, []).length;

const received = $$PREBID_GLOBAL$$._bidsReceived.filter(bid => bid.adUnitCode === adUnitCode).length;
return requested === received;
}

function add(a, b) {
return a + b;
}

function bidsBackAll() {
const requested = $$PREBID_GLOBAL$$._bidsRequested
.map(request => request.bids)
.reduce(flatten, [])
.filter(adUnitsFilter.bind(this, $$PREBID_GLOBAL$$._adUnitCodes))
.map(bid => {
return bid.bidder === 'indexExchange'
? bid.sizes.length
: 1;
}).reduce((a, b) => a + b, 0);
.filter(adUnitsFilter.bind(this, $$PREBID_GLOBAL$$._adUnitCodes)).length;

const received = $$PREBID_GLOBAL$$._bidsReceived
.filter(adUnitsFilter.bind(this, $$PREBID_GLOBAL$$._adUnitCodes)).length;
Expand Down

0 comments on commit d3cd291

Please sign in to comment.