Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Bid/Analytics/ID/ other modules: import utils functions as needed and not the whole module #7498

Merged
merged 90 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
33762d1
added support for pubcommon, digitrust, id5id
pm-harshad-mane Sep 12, 2019
0722354
added support for IdentityLink
pm-harshad-mane Sep 13, 2019
f2c32c0
changed the source for id5
pm-harshad-mane Sep 13, 2019
37163d1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 13, 2019
eaed987
added unit test cases
pm-harshad-mane Sep 13, 2019
602ee7e
changed source param for identityLink
pm-harshad-mane Sep 16, 2019
b6fcd36
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 23, 2019
58381f3
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 26, 2019
c9fb11b
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 10, 2019
8ece7fd
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 16, 2019
28d12a0
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 16, 2019
05a55e1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 31, 2019
e8b10d5
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 5, 2019
870085f
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 12, 2019
844ce4e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 12, 2019
704eca3
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 13, 2019
2565cb9
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 4, 2019
1d75bd4
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 4, 2019
6adde1e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 6, 2019
477c98a
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 9, 2019
cef5422
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 10, 2019
c110a7d
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jan 9, 2020
e8fb062
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 5, 2020
d77cd71
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 17, 2020
817ce3f
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 24, 2020
cda825e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 26, 2020
f34a3ec
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 27, 2020
f106dc8
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 4, 2020
1f6937e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 6, 2020
06ffe84
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 6, 2020
5448ceb
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 6, 2020
e9b90fe
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 11, 2020
a7a1d12
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 11, 2020
30b72df
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 26, 2020
76adbc9
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 30, 2020
50e13bc
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 30, 2020
a1c7ca1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 30, 2020
96fbadc
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 1, 2020
4b026e2
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 9, 2020
38740bc
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 10, 2020
9daf778
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 20, 2020
eff8828
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 21, 2020
ede95de
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 21, 2020
c98f1a1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 23, 2020
312da6d
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane May 18, 2020
d92972c
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 1, 2020
fd4fb2e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 26, 2020
e551136
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 30, 2020
cfdca3c
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jul 7, 2020
22505ff
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jul 28, 2020
795a54a
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Aug 10, 2020
433c98b
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 3, 2020
a0521ac
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 24, 2020
635fe74
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 25, 2020
2759212
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 12, 2020
84737d8
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 2, 2020
df5fada
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 2, 2020
9ab7840
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 2, 2020
ed4b566
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jan 8, 2021
f57d220
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jan 20, 2021
6a6d1f4
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 9, 2021
3650c9d
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 10, 2021
85c9d49
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 18, 2021
ca82340
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 23, 2021
12e8f47
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 8, 2021
5d024e7
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 15, 2021
4c87d00
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 22, 2021
93ea6ca
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane May 6, 2021
1eaefc8
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 2, 2021
cd4a279
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 7, 2021
4e9ff9f
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Aug 6, 2021
f971232
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Aug 11, 2021
24b2cd0
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 6, 2021
6d3d8a1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 10, 2021
ae6dbb2
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 21, 2021
a691bc0
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 23, 2021
bb3ceb1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 23, 2021
05b7793
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 24, 2021
51755a1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 24, 2021
64fdc3b
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 24, 2021
bc6c9f6
import utils functions as needed and not the whole module
pm-harshad-mane Sep 24, 2021
ef500ab
import utils functions as needed and not the whole module
pm-harshad-mane Sep 24, 2021
7e3fa3f
import utils functions as needed and not the whole module
pm-harshad-mane Sep 24, 2021
0a32ede
Revert "import utils functions as needed and not the whole module"
pm-harshad-mane Sep 24, 2021
e4dc495
Revert "import utils functions as needed and not the whole module"
pm-harshad-mane Sep 24, 2021
9e42ba5
Revert "import utils functions as needed and not the whole module"
pm-harshad-mane Sep 24, 2021
e14def7
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 27, 2021
8200e6b
import utils functions as needed and not the whole module
pm-harshad-mane Sep 27, 2021
232d94a
import utils functions as needed and not the whole module
pm-harshad-mane Sep 27, 2021
f64776f
import utils functions as needed and not the whole module
pm-harshad-mane Sep 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions modules/timeoutRtdProvider.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { submodule } from '../src/hook.js';
import * as ajax from '../src/ajax.js';
import * as utils from '../src/utils.js';
import { logInfo, deepAccess, logError } from '../src/utils.js';
import { getGlobal } from '../src/prebidGlobal.js';

const SUBMODULE_NAME = 'timeout';
Expand Down Expand Up @@ -70,14 +70,14 @@ function getConnectionSpeed() {
* @return {int}
*/
function calculateTimeoutModifier(adUnits, rules) {
utils.logInfo('Timeout rules', rules);
logInfo('Timeout rules', rules);
let timeoutModifier = 0;
let toAdd = 0;

if (rules.includesVideo) {
const hasVideo = timeoutRtdFunctions.checkVideo(adUnits);
toAdd = rules.includesVideo[hasVideo] || 0;
utils.logInfo(`Adding ${toAdd} to timeout for includesVideo ${hasVideo}`)
logInfo(`Adding ${toAdd} to timeout for includesVideo ${hasVideo}`)
timeoutModifier += toAdd;
}

Expand All @@ -89,7 +89,7 @@ function calculateTimeoutModifier(adUnits, rules) {
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}`)
logInfo(`Adding ${timeoutVal} to timeout for numAdUnits ${numAdUnits}`)
timeoutModifier += timeoutVal;
break;
}
Expand All @@ -100,18 +100,18 @@ function calculateTimeoutModifier(adUnits, rules) {
if (rules.deviceType) {
const deviceType = timeoutRtdFunctions.getDeviceType();
toAdd = rules.deviceType[deviceType] || 0;
utils.logInfo(`Adding ${toAdd} to timeout for deviceType ${deviceType}`)
logInfo(`Adding ${toAdd} to timeout for deviceType ${deviceType}`)
timeoutModifier += toAdd;
}

if (rules.connectionSpeed) {
const connectionSpeed = timeoutRtdFunctions.getConnectionSpeed();
toAdd = rules.connectionSpeed[connectionSpeed] || 0;
utils.logInfo(`Adding ${toAdd} to timeout for connectionSpeed ${connectionSpeed}`)
logInfo(`Adding ${toAdd} to timeout for connectionSpeed ${connectionSpeed}`)
timeoutModifier += toAdd;
}

utils.logInfo('timeout Modifier calculated', timeoutModifier);
logInfo('timeout Modifier calculated', timeoutModifier);
return timeoutModifier;
}

Expand All @@ -123,30 +123,30 @@ function calculateTimeoutModifier(adUnits, rules) {
* @param {Object} userConsent
*/
function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) {
utils.logInfo('Timeout rtd config', config);
const timeoutUrl = utils.deepAccess(config, 'params.endpoint.url');
logInfo('Timeout rtd config', config);
const timeoutUrl = deepAccess(config, 'params.endpoint.url');
if (timeoutUrl) {
utils.logInfo('Timeout url', timeoutUrl);
logInfo('Timeout url', timeoutUrl);
ajax.ajaxBuilder()(timeoutUrl, {
success: function(response) {
try {
const rules = JSON.parse(response);
timeoutRtdFunctions.handleTimeoutIncrement(reqBidsConfigObj, rules);
} catch (e) {
utils.logError('Error parsing json response from timeout provider.')
logError('Error parsing json response from timeout provider.')
}
callback();
},
error: function(errorStatus) {
utils.logError('Timeout request error!', errorStatus);
logError('Timeout request error!', errorStatus);
callback();
}
});
} else if (utils.deepAccess(config, 'params.rules')) {
timeoutRtdFunctions.handleTimeoutIncrement(reqBidsConfigObj, utils.deepAccess(config, 'params.rules'));
} else if (deepAccess(config, 'params.rules')) {
timeoutRtdFunctions.handleTimeoutIncrement(reqBidsConfigObj, deepAccess(config, 'params.rules'));
callback();
} else {
utils.logInfo('No timeout endpoint or timeout rules found. Exiting timeout rtd module');
logInfo('No timeout endpoint or timeout rules found. Exiting timeout rtd module');
callback();
}
}
Expand Down
6 changes: 3 additions & 3 deletions modules/tpmnBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-tabs */
import { registerBidder } from '../src/adapters/bidderFactory.js';
import * as utils from '../src/utils.js';
import { parseUrl, deepAccess } from '../src/utils.js';
import { BANNER } from '../src/mediaTypes.js';

export const ADAPTER_VERSION = '1';
Expand Down Expand Up @@ -72,7 +72,7 @@ registerBidder(spec);
* Creates site description object
*/
function createSite(refInfo) {
let url = utils.parseUrl(refInfo.referer);
let url = parseUrl(refInfo.referer);
let site = {
'domain': url.hostname,
'page': url.protocol + '://' + url.hostname + url.pathname
Expand Down Expand Up @@ -102,7 +102,7 @@ function parseSizes(sizes) {
}

function getBannerSizes(bidRequest) {
return parseSizes(utils.deepAccess(bidRequest, 'mediaTypes.banner.sizes') || bidRequest.sizes);
return parseSizes(deepAccess(bidRequest, 'mediaTypes.banner.sizes') || bidRequest.sizes);
}

function bidToRequest(bid) {
Expand Down
30 changes: 15 additions & 15 deletions modules/trionBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as utils from '../src/utils.js';
import { getBidIdParameter, parseSizesInput, tryAppendQueryString } from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { getStorageManager } from '../src/storageManager.js';

Expand Down Expand Up @@ -112,11 +112,11 @@ function getPublisherUrl() {
}

function buildTrionUrlParams(bid, bidderRequest) {
var pubId = utils.getBidIdParameter('pubId', bid.params);
var sectionId = utils.getBidIdParameter('sectionId', bid.params);
var pubId = getBidIdParameter('pubId', bid.params);
var sectionId = getBidIdParameter('sectionId', bid.params);
var url = getPublisherUrl();
var bidSizes = getBidSizesFromBidRequest(bid);
var sizes = utils.parseSizesInput(bidSizes).join(',');
var sizes = parseSizesInput(bidSizes).join(',');
var isAutomated = (navigator && navigator.webdriver) ? '1' : '0';
var isHidden = (document.hidden) ? '1' : '0';
var visibilityState = encodeURIComponent(document.visibilityState);
Expand All @@ -131,33 +131,33 @@ function buildTrionUrlParams(bid, bidderRequest) {
setStorageData(BASE_KEY + 'lps', pubId + ':' + sectionId);
var trionUrl = '';

trionUrl = utils.tryAppendQueryString(trionUrl, 'bidId', bid.bidId);
trionUrl = utils.tryAppendQueryString(trionUrl, 'pubId', pubId);
trionUrl = utils.tryAppendQueryString(trionUrl, 'sectionId', sectionId);
trionUrl = utils.tryAppendQueryString(trionUrl, 'vers', '$prebid.version$');
trionUrl = tryAppendQueryString(trionUrl, 'bidId', bid.bidId);
trionUrl = tryAppendQueryString(trionUrl, 'pubId', pubId);
trionUrl = tryAppendQueryString(trionUrl, 'sectionId', sectionId);
trionUrl = tryAppendQueryString(trionUrl, 'vers', '$prebid.version$');
if (url) {
trionUrl += 'url=' + url + '&';
}
if (sizes) {
trionUrl += 'sizes=' + sizes + '&';
}
if (intT) {
trionUrl = utils.tryAppendQueryString(trionUrl, 'int_t', encodeURIComponent(intT));
trionUrl = tryAppendQueryString(trionUrl, 'int_t', encodeURIComponent(intT));
}
trionUrl = utils.tryAppendQueryString(trionUrl, 'tr_wd', isAutomated);
trionUrl = utils.tryAppendQueryString(trionUrl, 'tr_hd', isHidden);
trionUrl = utils.tryAppendQueryString(trionUrl, 'tr_vs', visibilityState);
trionUrl = tryAppendQueryString(trionUrl, 'tr_wd', isAutomated);
trionUrl = tryAppendQueryString(trionUrl, 'tr_hd', isHidden);
trionUrl = tryAppendQueryString(trionUrl, 'tr_vs', visibilityState);
if (bidderRequest && bidderRequest.gdprConsent) {
var gdpr = bidderRequest.gdprConsent;
if (gdpr) {
if (gdpr.consentString) {
trionUrl = utils.tryAppendQueryString(trionUrl, 'gdprc', encodeURIComponent(gdpr.consentString));
trionUrl = tryAppendQueryString(trionUrl, 'gdprc', encodeURIComponent(gdpr.consentString));
}
trionUrl = utils.tryAppendQueryString(trionUrl, 'gdpr', (gdpr.gdprApplies ? 1 : 0));
trionUrl = tryAppendQueryString(trionUrl, 'gdpr', (gdpr.gdprApplies ? 1 : 0));
}
}
if (bidderRequest && bidderRequest.uspConsent) {
trionUrl = utils.tryAppendQueryString(trionUrl, 'usp', encodeURIComponent(bidderRequest.uspConsent));
trionUrl = tryAppendQueryString(trionUrl, 'usp', encodeURIComponent(bidderRequest.uspConsent));
}
// remove the trailing "&"
if (trionUrl.lastIndexOf('&') === trionUrl.length - 1) {
Expand Down
46 changes: 23 additions & 23 deletions modules/tripleliftBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { tryAppendQueryString, logMessage, isEmpty } from '../src/utils.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import * as utils from '../src/utils.js';
import { config } from '../src/config.js';

const GVLID = 28;
Expand All @@ -23,41 +23,41 @@ export const tripleliftAdapterSpec = {
let tlCall = STR_ENDPOINT;
let data = _buildPostBody(bidRequests);

tlCall = utils.tryAppendQueryString(tlCall, 'lib', 'prebid');
tlCall = utils.tryAppendQueryString(tlCall, 'v', '$prebid.version$');
tlCall = tryAppendQueryString(tlCall, 'lib', 'prebid');
tlCall = tryAppendQueryString(tlCall, 'v', '$prebid.version$');

if (bidderRequest && bidderRequest.refererInfo) {
let referrer = bidderRequest.refererInfo.referer;
tlCall = utils.tryAppendQueryString(tlCall, 'referrer', referrer);
tlCall = tryAppendQueryString(tlCall, 'referrer', referrer);
}

if (bidderRequest && bidderRequest.timeout) {
tlCall = utils.tryAppendQueryString(tlCall, 'tmax', bidderRequest.timeout);
tlCall = tryAppendQueryString(tlCall, 'tmax', bidderRequest.timeout);
}

if (bidderRequest && bidderRequest.gdprConsent) {
if (typeof bidderRequest.gdprConsent.gdprApplies !== 'undefined') {
gdprApplies = bidderRequest.gdprConsent.gdprApplies;
tlCall = utils.tryAppendQueryString(tlCall, 'gdpr', gdprApplies.toString());
tlCall = tryAppendQueryString(tlCall, 'gdpr', gdprApplies.toString());
}
if (typeof bidderRequest.gdprConsent.consentString !== 'undefined') {
consentString = bidderRequest.gdprConsent.consentString;
tlCall = utils.tryAppendQueryString(tlCall, 'cmp_cs', consentString);
tlCall = tryAppendQueryString(tlCall, 'cmp_cs', consentString);
}
}

if (bidderRequest && bidderRequest.uspConsent) {
tlCall = utils.tryAppendQueryString(tlCall, 'us_privacy', bidderRequest.uspConsent);
tlCall = tryAppendQueryString(tlCall, 'us_privacy', bidderRequest.uspConsent);
}

if (config.getConfig('coppa') === true) {
tlCall = utils.tryAppendQueryString(tlCall, 'coppa', true);
tlCall = tryAppendQueryString(tlCall, 'coppa', true);
}

if (tlCall.lastIndexOf('&') === tlCall.length - 1) {
tlCall = tlCall.substring(0, tlCall.length - 1);
}
utils.logMessage('tlCall request built: ' + tlCall);
logMessage('tlCall request built: ' + tlCall);

return {
method: 'POST',
Expand All @@ -81,17 +81,17 @@ export const tripleliftAdapterSpec = {
let syncEndpoint = 'https://eb2.3lift.com/sync?';

if (syncType === 'image') {
syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'px', 1);
syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'src', 'prebid');
syncEndpoint = tryAppendQueryString(syncEndpoint, 'px', 1);
syncEndpoint = tryAppendQueryString(syncEndpoint, 'src', 'prebid');
}

if (consentString !== null) {
syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'gdpr', gdprApplies);
syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'cmp_cs', consentString);
syncEndpoint = tryAppendQueryString(syncEndpoint, 'gdpr', gdprApplies);
syncEndpoint = tryAppendQueryString(syncEndpoint, 'cmp_cs', consentString);
}

if (usPrivacy) {
syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'us_privacy', usPrivacy);
syncEndpoint = tryAppendQueryString(syncEndpoint, 'us_privacy', usPrivacy);
}

return [{
Expand Down Expand Up @@ -124,7 +124,7 @@ function _buildPostBody(bidRequests) {
} else if (bidRequest.mediaTypes.banner) {
imp.banner = { format: _sizes(bidRequest.sizes) };
};
if (!utils.isEmpty(bidRequest.ortb2Imp)) {
if (!isEmpty(bidRequest.ortb2Imp)) {
imp.fpd = _getAdUnitFpd(bidRequest.ortb2Imp);
}
return imp;
Expand All @@ -145,7 +145,7 @@ function _buildPostBody(bidRequests) {

let ext = _getExt(schain, globalFpd);

if (!utils.isEmpty(ext)) {
if (!isEmpty(ext)) {
data.ext = ext;
}
return data;
Expand Down Expand Up @@ -200,10 +200,10 @@ function _getGlobalFpd() {
_addEntries(context, fpdContext);
_addEntries(user, fpdUser);

if (!utils.isEmpty(context)) {
if (!isEmpty(context)) {
fpd.context = context;
}
if (!utils.isEmpty(user)) {
if (!isEmpty(user)) {
fpd.user = user;
}
return fpd;
Expand All @@ -215,15 +215,15 @@ function _getAdUnitFpd(adUnitFpd) {

_addEntries(context, adUnitFpd.ext);

if (!utils.isEmpty(context)) {
if (!isEmpty(context)) {
fpd.context = context;
}

return fpd;
}

function _addEntries(target, source) {
if (!utils.isEmpty(source)) {
if (!isEmpty(source)) {
Object.keys(source).forEach(key => {
if (source[key] != null) {
target[key] = source[key];
Expand All @@ -234,10 +234,10 @@ function _addEntries(target, source) {

function _getExt(schain, fpd) {
let ext = {};
if (!utils.isEmpty(schain)) {
if (!isEmpty(schain)) {
ext.schain = { ...schain };
}
if (!utils.isEmpty(fpd)) {
if (!isEmpty(fpd)) {
ext.fpd = { ...fpd };
}
return ext;
Expand Down
8 changes: 4 additions & 4 deletions modules/truereachBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as utils from '../src/utils.js';
import { deepAccess, getUniqueIdentifierStr } from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { config } from '../src/config.js';
import { BANNER } from '../src/mediaTypes.js';
Expand All @@ -13,7 +13,7 @@ export const spec = {

isBidRequestValid: function (bidRequest) {
return (bidRequest.params.site_id && bidRequest.params.bidfloor &&
utils.deepAccess(bidRequest, 'mediaTypes.banner') && (utils.deepAccess(bidRequest, 'mediaTypes.banner.sizes.length') > 0));
deepAccess(bidRequest, 'mediaTypes.banner') && (deepAccess(bidRequest, 'mediaTypes.banner.sizes.length') > 0));
},

buildRequests: function (validBidRequests, bidderRequest) {
Expand All @@ -23,7 +23,7 @@ export const spec = {

let queryParams = buildCommonQueryParamsFromBids(validBidRequests, bidderRequest);

let siteId = utils.deepAccess(validBidRequests[0], 'params.site_id');
let siteId = deepAccess(validBidRequests[0], 'params.site_id');

let url = BIDDER_URL + siteId + '?hb=1&transactionId=' + validBidRequests[0].transactionId;

Expand Down Expand Up @@ -121,7 +121,7 @@ function buildCommonQueryParamsFromBids(validBidRequests, bidderRequest) {
let page = window.location.host + window.location.pathname + location.search + location.hash;

let defaultParams = {
id: utils.getUniqueIdentifierStr(),
id: getUniqueIdentifierStr(),
imp: [
{
id: validBidRequests[0].bidId,
Expand Down
Loading