Skip to content

Commit

Permalink
small refactor inspired on prebid#9952
Browse files Browse the repository at this point in the history
  • Loading branch information
peczenyj committed May 26, 2023
1 parent 919540a commit 3959260
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/weboramaRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ const WEBO_USER_DATA_SOURCE_LABEL = 'wam';
const SFBX_LITE_DATA_SOURCE_LABEL = 'lite';
/** @type {number} */
const GVLID = 284;
/** @type {string} */
const LEGACY_SITE_KEYWORDS_BIDDERS = ['appnexus'];

export const storage = getStorageManager({
moduleType: MODULE_TYPE_RTD,
Expand Down Expand Up @@ -689,8 +691,8 @@ class WeboramaRtdProvider {
/** @type {string} */
const bidder = bidderAliasRegistry[bid.bidder] || bid.bidder;

if (bidder == 'appnexus') {
this.#handleAppnexusBid(reqBidsConfigObj, bid, profile, metadata);
if (LEGACY_SITE_KEYWORDS_BIDDERS.includes(bidder)) {
this.#handleSiteLegacyKeywordsBidders(reqBidsConfigObj, bid, profile, metadata);
}
}

Expand All @@ -705,7 +707,7 @@ class WeboramaRtdProvider {
return [deepClone(ph.data), deepClone(ph.metadata)];
}

/** handle appnexus/xandr bid
/** handle site legacy keywords bidders like appnexus/xandr
* @method
* @private
* @param {Object} reqBidsConfigObj
Expand All @@ -718,7 +720,7 @@ class WeboramaRtdProvider {
* @returns {void}
*/
// eslint-disable-next-line no-dupe-class-members
#handleAppnexusBid(reqBidsConfigObj, bid, profile, metadata) {
#handleSiteLegacyKeywordsBidders(reqBidsConfigObj, bid, profile, metadata) {
if (metadata.user) {
this.#setBidderOrtb2(reqBidsConfigObj.ortb2Fragments?.bidder, bid.bidder, 'user.keywords', profile);
} else {
Expand Down

0 comments on commit 3959260

Please sign in to comment.