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

Change Variable Typo and Make Variable Name More Descriptive #6217

Merged
merged 1 commit into from
Jan 25, 2021
Merged
Changes from all commits
Commits
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
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