Skip to content

Commit

Permalink
replace find reference with imported version (prebid#2542)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker authored and dluxemburg committed Jul 17, 2018
1 parent 2c2cd4b commit 6f1f71c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ function getPreparedBidForAuction({adUnitCode, bid, bidRequest, auctionId}) {
events.emit(CONSTANTS.EVENTS.BID_ADJUSTMENT, bidObject);

// a publisher-defined renderer can be used to render bids
const bidReq = bidRequest.bids && bidRequest.bids.find(bid => bid.adUnitCode == adUnitCode);
const bidReq = bidRequest.bids && find(bidRequest.bids, bid => bid.adUnitCode == adUnitCode);
const adUnitRenderer = bidReq && bidReq.renderer;

if (adUnitRenderer && adUnitRenderer.url) {
Expand Down
3 changes: 2 additions & 1 deletion test/spec/auctionmanager_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { newBidder, registerBidder } from 'src/adapters/bidderFactory';
import { config } from 'src/config';
import * as store from 'src/videoCache';
import * as ajaxLib from 'src/ajax';
import find from 'core-js/library/fn/array/find';

const adloader = require('../../src/adloader');
var assert = require('assert');
Expand Down Expand Up @@ -669,7 +670,7 @@ describe('auctionmanager.js', function () {

auction.callBids();

const addedBid = auction.getBidsReceived().find(bid => bid.adUnitCode == ADUNIT_CODE);
const addedBid = find(auction.getBidsReceived(), bid => bid.adUnitCode == ADUNIT_CODE);
assert.equal(addedBid.renderer.url, 'renderer.js');
});
});
Expand Down

0 comments on commit 6f1f71c

Please sign in to comment.