Skip to content

Commit

Permalink
typo and var name improvement (#6217)
Browse files Browse the repository at this point in the history
Co-authored-by: karimJWP <karimJWP@github.com>
  • Loading branch information
karimMourra and karimJWP authored Jan 25, 2021
1 parent 817f06e commit 534db98
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/adapterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,18 +399,18 @@ function isTestingServerOnly() {
};

function getSupportedMediaTypes(bidderCode) {
let result = [];
if (includes(adapterManager.videoAdapters, bidderCode)) result.push('video');
if (includes(nativeAdapters, bidderCode)) result.push('native');
return result;
let supportedMediaTypes = [];
if (includes(adapterManager.videoAdapters, bidderCode)) supportedMediaTypes.push('video');
if (includes(nativeAdapters, bidderCode)) supportedMediaTypes.push('native');
return supportedMediaTypes;
}

adapterManager.videoAdapters = []; // added by adapterLoader for now

adapterManager.registerBidAdapter = function (bidAdaptor, bidderCode, {supportedMediaTypes = []} = {}) {
if (bidAdaptor && bidderCode) {
if (typeof bidAdaptor.callBids === 'function') {
_bidderRegistry[bidderCode] = bidAdaptor;
adapterManager.registerBidAdapter = function (bidAdapter, bidderCode, {supportedMediaTypes = []} = {}) {
if (bidAdapter && bidderCode) {
if (typeof bidAdapter.callBids === 'function') {
_bidderRegistry[bidderCode] = bidAdapter;

if (includes(supportedMediaTypes, 'video')) {
adapterManager.videoAdapters.push(bidderCode);
Expand All @@ -422,16 +422,16 @@ adapterManager.registerBidAdapter = function (bidAdaptor, bidderCode, {supported
utils.logError('Bidder adaptor error for bidder code: ' + bidderCode + 'bidder must implement a callBids() function');
}
} else {
utils.logError('bidAdaptor or bidderCode not specified');
utils.logError('bidAdapter or bidderCode not specified');
}
};

adapterManager.aliasBidAdapter = function (bidderCode, alias, options) {
let existingAlias = _bidderRegistry[alias];

if (typeof existingAlias === 'undefined') {
let bidAdaptor = _bidderRegistry[bidderCode];
if (typeof bidAdaptor === 'undefined') {
let bidAdapter = _bidderRegistry[bidderCode];
if (typeof bidAdapter === 'undefined') {
// check if alias is part of s2sConfig and allow them to register if so (as base bidder may be s2s-only)
const s2sConfig = config.getConfig('s2sConfig');
const s2sBidders = s2sConfig && s2sConfig.bidders;
Expand All @@ -447,11 +447,11 @@ adapterManager.aliasBidAdapter = function (bidderCode, alias, options) {
let supportedMediaTypes = getSupportedMediaTypes(bidderCode);
// Have kept old code to support backward compatibilitiy.
// Remove this if loop when all adapters are supporting bidderFactory. i.e When Prebid.js is 1.0
if (bidAdaptor.constructor.prototype != Object.prototype) {
newAdapter = new bidAdaptor.constructor();
if (bidAdapter.constructor.prototype != Object.prototype) {
newAdapter = new bidAdapter.constructor();
newAdapter.setBidderCode(alias);
} else {
let spec = bidAdaptor.getSpec();
let spec = bidAdapter.getSpec();
let gvlid = options && options.gvlid;
let skipPbsAliasing = options && options.skipPbsAliasing;
newAdapter = newBidder(Object.assign({}, spec, { code: alias, gvlid, skipPbsAliasing }));
Expand Down

0 comments on commit 534db98

Please sign in to comment.