Skip to content

Commit

Permalink
1206 eslint repair camel case (prebid#2925)
Browse files Browse the repository at this point in the history
* Camel Case issues addresed

* after merge cleanup

* updated between adapter
  • Loading branch information
jrosendahl authored and AdSpacesDevelopers committed Jan 30, 2019
1 parent 72d8ae2 commit c00ac39
Show file tree
Hide file tree
Showing 22 changed files with 130 additions and 128 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = {
// Violations of these styles should be fixed, and the exceptions removed over time.
//
// See Issue #1111.
"camelcase": "off",
"eqeqeq": "off",
"no-return-assign": "off",
"no-throw-literal": "off",
Expand Down
2 changes: 1 addition & 1 deletion modules/adkernelAdnBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const spec = {
return serverResponses.filter(rps => rps.body && rps.body.syncpages)
.map(rsp => rsp.body.syncpages)
.reduce((a, b) => a.concat(b), [])
.map(sync_url => ({type: 'iframe', url: sync_url}));
.map(syncUrl => ({type: 'iframe', url: syncUrl}));
}
};

Expand Down
2 changes: 1 addition & 1 deletion modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const spec = {
return serverResponses.filter(rsp => rsp.body && rsp.body.ext && rsp.body.ext.adk_usersync)
.map(rsp => rsp.body.ext.adk_usersync)
.reduce((a, b) => a.concat(b), [])
.map(sync_url => ({type: 'iframe', url: sync_url}));
.map(syncUrl => ({type: 'iframe', url: syncUrl}));
}
};

Expand Down
2 changes: 1 addition & 1 deletion modules/andbeyondBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const spec = {
return serverResponses.filter(rsp => rsp.body && rsp.body.ext && rsp.body.ext.adk_usersync)
.map(rsp => rsp.body.ext.adk_usersync)
.reduce((a, b) => a.concat(b), [])
.map(sync_url => ({type: 'iframe', url: sync_url}));
.map(syncUrl => ({type: 'iframe', url: syncUrl}));
}
};

Expand Down
12 changes: 6 additions & 6 deletions modules/audienceNetworkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const method = 'GET';
const url = 'https://an.facebook.com/v2/placementbid.json';
const supportedMediaTypes = ['banner', 'video'];
const netRevenue = true;
const hb_bidder = 'fan';
const hbBidder = 'fan';
const platver = '$prebid.version$';
const platform = '241394079772386';
const adapterver = '1.0.0';
Expand Down Expand Up @@ -205,14 +205,14 @@ const interpretResponse = ({ body }, { adformats, requestIds, sizes }) => {
// transform to bidResponse
.map((bid, i) => {
const {
bid_id: fb_bidid,
bid_id: fbBidid,
placement_id: creativeId,
bid_price_cents: cpm
} = bid;

const format = adformats[i];
const [width, height] = expandSize(flattenSize(sizes[i]));
const ad = createAdHtml(creativeId, format, fb_bidid);
const ad = createAdHtml(creativeId, format, fbBidid);
const requestId = requestIds[i];

const bidResponse = {
Expand All @@ -227,16 +227,16 @@ const interpretResponse = ({ body }, { adformats, requestIds, sizes }) => {
netRevenue,
currency,
// Audience Network attributes
hb_bidder,
fb_bidid,
hb_bidder: hbBidder,
fb_bidid: fbBidid,
fb_format: format,
fb_placementid: creativeId
};
// Video attributes
if (isVideo(format)) {
const pageurl = getTopWindowUrlEncoded();
bidResponse.mediaType = 'video';
bidResponse.vastUrl = `https://an.facebook.com/v1/instream/vast.xml?placementid=${creativeId}&pageurl=${pageurl}&playerwidth=${width}&playerheight=${height}&bidid=${fb_bidid}`;
bidResponse.vastUrl = `https://an.facebook.com/v1/instream/vast.xml?placementid=${creativeId}&pageurl=${pageurl}&playerwidth=${width}&playerheight=${height}&bidid=${fbBidid}`;
}
return bidResponse;
});
Expand Down
12 changes: 6 additions & 6 deletions modules/betweenBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export const spec = {
let params = {
jst: 'hb',
ord: Math.random() * 10000000000000000,
tz: get_tz(),
fl: get_fl(),
rr: get_rr(),
tz: getTz(),
fl: getFl(),
rr: getRr(),
w: i.params.w,
h: i.params.h,
s: i.params.s,
Expand Down Expand Up @@ -114,7 +114,7 @@ export const spec = {
}
}

function get_rr() {
function getRr() {
try {
var td = top.document;
var rr = td.referrer;
Expand All @@ -127,7 +127,7 @@ function get_rr() {
}
}

function get_fl() {
function getFl() {
if (navigator.plugins !== undefined && navigator.plugins !== null) {
if (navigator.plugins['Shockwave Flash'] !== undefined && navigator.plugins['Shockwave Flash'] !== null && typeof navigator.plugins['Shockwave Flash'] === 'object') {
var description = navigator.plugins['Shockwave Flash'].description;
Expand All @@ -142,7 +142,7 @@ function get_fl() {
return 0;
}

function get_tz() {
function getTz() {
return new Date().getTimezoneOffset();
}

Expand Down
40 changes: 20 additions & 20 deletions modules/bridgewellBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,35 +164,35 @@ export const spec = {
return;
}

let req_nativeLayout = req.mediaTypes.native;
let res_native = matchedResponse.native;
let reqNativeLayout = req.mediaTypes.native;
let resNative = matchedResponse.native;

// check title
let title = req_nativeLayout.title;
let title = reqNativeLayout.title;
if (title && title.required) {
if (typeof res_native.title !== 'string') {
if (typeof resNative.title !== 'string') {
return;
} else if (title.len && title.len < res_native.title.length) {
} else if (title.len && title.len < resNative.title.length) {
return;
}
}

// check body
let body = req_nativeLayout.body;
let body = reqNativeLayout.body;
if (body && body.required) {
if (typeof res_native.body !== 'string') {
if (typeof resNative.body !== 'string') {
return;
}
}

// check image
let image = req_nativeLayout.image;
let image = reqNativeLayout.image;
if (image && image.required) {
if (res_native.image) {
if (typeof res_native.image.url !== 'string') { // check image url
if (resNative.image) {
if (typeof resNative.image.url !== 'string') { // check image url
return;
} else {
if (res_native.image.width !== image.sizes[0] || res_native.image.height !== image.sizes[1]) { // check image sizes
if (resNative.image.width !== image.sizes[0] || resNative.image.height !== image.sizes[1]) { // check image sizes
return;
}
}
Expand All @@ -202,21 +202,21 @@ export const spec = {
}

// check sponsoredBy
let sponsoredBy = req_nativeLayout.sponsoredBy;
let sponsoredBy = reqNativeLayout.sponsoredBy;
if (sponsoredBy && sponsoredBy.required) {
if (typeof res_native.sponsoredBy !== 'string') {
if (typeof resNative.sponsoredBy !== 'string') {
return;
}
}

// check icon
let icon = req_nativeLayout.icon;
let icon = reqNativeLayout.icon;
if (icon && icon.required) {
if (res_native.icon) {
if (typeof res_native.icon.url !== 'string') { // check icon url
if (resNative.icon) {
if (typeof resNative.icon.url !== 'string') { // check icon url
return;
} else {
if (res_native.icon.width !== icon.sizes[0] || res_native.icon.height !== icon.sizes[0]) { // check image sizes
if (resNative.icon.width !== icon.sizes[0] || resNative.icon.height !== icon.sizes[0]) { // check image sizes
return;
}
}
Expand All @@ -226,12 +226,12 @@ export const spec = {
}

// check clickUrl
if (typeof res_native.clickUrl !== 'string') {
if (typeof resNative.clickUrl !== 'string') {
return;
}

// check clickTracker
let clickTrackers = res_native.clickTrackers;
let clickTrackers = resNative.clickTrackers;
if (clickTrackers) {
if (clickTrackers.length === 0) {
return;
Expand All @@ -241,7 +241,7 @@ export const spec = {
}

// check impressionTrackers
let impressionTrackers = res_native.impressionTrackers;
let impressionTrackers = resNative.impressionTrackers;
if (impressionTrackers) {
if (impressionTrackers.length === 0) {
return;
Expand Down
10 changes: 5 additions & 5 deletions modules/etargetBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {registerBidder} from 'src/adapters/bidderFactory';
import { BANNER, VIDEO } from 'src/mediaTypes';

const BIDDER_CODE = 'etarget';
const country_map = {
const countryMap = {
1: 'sk',
2: 'cz',
3: 'hu',
Expand All @@ -28,18 +28,18 @@ export const spec = {
var i, l, bid, reqParams, netRevenue, gdprObject;
var request = [];
var bids = JSON.parse(JSON.stringify(validBidRequests));
var last_contry = 'sk';
var lastContry = 'sk';
for (i = 0, l = bids.length; i < l; i++) {
bid = bids[i];
if (country_map[bid.params.country]) {
last_contry = country_map[bid.params.country];
if (countryMap[bid.params.country]) {
lastContry = countryMap[bid.params.country];
}
reqParams = bid.params;
reqParams.transactionId = bid.transactionId;
request.push(formRequestUrl(reqParams));
}

request.unshift('//' + last_contry + '.search.etargetnet.com/hb/?hbget=1');
request.unshift('//' + lastContry + '.search.etargetnet.com/hb/?hbget=1');
netRevenue = 'net';

if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies) {
Expand Down
4 changes: 2 additions & 2 deletions modules/nasmediaAdmixerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ export const spec = {
function getOsType() {
let ua = navigator.userAgent.toLowerCase();
let os = ['android', 'ios', 'mac', 'linux', 'window'];
let regexp_os = [/android/i, /iphone|ipad/i, /mac/i, /linux/i, /window/i];
let regexpOs = [/android/i, /iphone|ipad/i, /mac/i, /linux/i, /window/i];

return find(os, (tos, idx) => {
if (ua.match(regexp_os[idx])) {
if (ua.match(regexpOs[idx])) {
return os[idx];
}
}) || 'etc';
Expand Down
24 changes: 12 additions & 12 deletions modules/polluxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,41 @@ export const spec = {
return [];
}
const payload = [];
let custom_url = null;
let customUrl = null;
for (let i = 0; i < validBidRequests.length; i++) {
const bid = validBidRequests[i];
const request = {
bidId: bid.bidId,
zones: bid.params.zone,
sizes: bid.sizes
};
if (bid.bidderUrl && !custom_url) {
custom_url = bid.bidderUrl;
if (bid.bidderUrl && !customUrl) {
customUrl = bid.bidderUrl;
}
payload.push(request);
}
const payloadString = JSON.stringify(payload);
// build url parameters
const domain = utils.getParameterByName('domain');
const tracker2 = utils.getParameterByName('tracker2');
const url_params = {};
const urlParams = {};
if (domain) {
url_params.domain = domain;
urlParams.domain = domain;
} else {
url_params.domain = utils.getTopWindowUrl();
urlParams.domain = utils.getTopWindowUrl();
}
if (tracker2) {
url_params.tracker2 = tracker2;
urlParams.tracker2 = tracker2;
}
// build url
let bidder_url = custom_url || PLX_ENDPOINT_URL;
if (url_params) {
bidder_url = bidder_url + '?' + utils.parseQueryStringParameters(url_params);
let bidderUrl = customUrl || PLX_ENDPOINT_URL;
if (urlParams) {
bidderUrl = bidderUrl + '?' + utils.parseQueryStringParameters(urlParams);
}
utils.logMessage('== ' + BIDDER_CODE + ' == request built: ' + bidder_url);
utils.logMessage('== ' + BIDDER_CODE + ' == request built: ' + bidderUrl);
return {
method: 'POST',
url: bidder_url,
url: bidderUrl,
data: payloadString
};
},
Expand Down
Loading

0 comments on commit c00ac39

Please sign in to comment.