Skip to content

Commit

Permalink
Timeout RTD Provider & Insticator & Sharethrough Bid Adapter: bug fix…
Browse files Browse the repository at this point in the history
…es for imports (prebid#7424)

* Update timeoutRtdProvider.js

* Update timeoutRtdProvider.js

* Update timeoutRtdProvider.js

* Update sharethroughBidAdapter.js

* Update sharethroughBidAdapter.js

* Update sharethroughBidAdapter.js

* Update insticatorBidAdapter.js
  • Loading branch information
patmmccann authored and Chris Pabst committed Jan 10, 2022
1 parent 4b0c37d commit 722a3b2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion modules/insticatorBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
logError,
} from '../src/utils.js';
import { getStorageManager } from '../src/storageManager.js';
import find from 'core-js-pure/features/array/find.js';

const BIDDER_CODE = 'insticator';
const ENDPOINT = 'https://ex.ingage.tech/v1/openrtb'; // production endpoint
Expand Down Expand Up @@ -151,7 +152,7 @@ function buildRequest(validBidRequests, bidderRequest) {
}

function buildBid(bid, bidderRequest) {
const originalBid = bidderRequest.bids.find((b) => b.bidId === bid.impid);
const originalBid = find(bidderRequest.bids, (b) => b.bidId === bid.impid);

return {
requestId: bid.impid,
Expand Down
3 changes: 2 additions & 1 deletion modules/sharethroughBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as utils from '../src/utils.js';
import { config } from '../src/config.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { createEidsArray } from './userId/eids.js';
import find from 'core-js-pure/features/array/find.js';

const VERSION = '4.0.0';
const BIDDER_CODE = 'sharethrough';
Expand Down Expand Up @@ -270,7 +271,7 @@ function getProtocol() {
}

function matchRequest(id, request) {
return request.bidRequests.find(bid => bid.bidId === id);
return find(request.bidRequests, bid => bid.bidId === id);
}

// stub for ?? operator
Expand Down
10 changes: 9 additions & 1 deletion modules/timeoutRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export const timeoutRtdFunctions = {
handleTimeoutIncrement
};

const entries = Object.entries || function(obj) {
const ownProps = Object.keys(obj);
let i = ownProps.length;
let resArray = new Array(i);
while (i--) { resArray[i] = [ownProps[i], obj[ownProps[i]]]; }
return resArray;
};

function getDeviceType() {
const userAgent = window.navigator.userAgent.toLowerCase();
if ((/ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(userAgent))) {
Expand Down Expand Up @@ -78,7 +86,7 @@ function calculateTimeoutModifier(adUnits, rules) {
if (rules.numAdUnits[numAdUnits]) {
timeoutModifier += rules.numAdUnits[numAdUnits];
} else {
for (const [rangeStr, timeoutVal] of Object.entries(rules.numAdUnits)) {
for (const [rangeStr, timeoutVal] of entries(rules.numAdUnits)) {
const [lowerBound, upperBound] = rangeStr.split('-');
if (parseInt(lowerBound) <= numAdUnits && numAdUnits <= parseInt(upperBound)) {
utils.logInfo(`Adding ${timeoutVal} to timeout for numAdUnits ${numAdUnits}`)
Expand Down

0 comments on commit 722a3b2

Please sign in to comment.