Skip to content

Commit

Permalink
Merge branch 'master' of github.com:britepool/Prebid.js into Add-brit…
Browse files Browse the repository at this point in the history
…epool-userid-submodule
  • Loading branch information
cfaherty committed Aug 26, 2019
2 parents 7716089 + 60501c8 commit 84b6e09
Show file tree
Hide file tree
Showing 67 changed files with 5,001 additions and 7,273 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:9.0.0
- image: circleci/node:7.10

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down
32 changes: 5 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@

const sharedWhiteList = [
"core-js/library/fn/array/find", // no ie11
"core-js/library/fn/array/includes", // no ie11
"core-js/library/fn/set", // ie11 supports Set but not Set#values
"core-js/library/fn/string/includes", // no ie11
"core-js/library/fn/number/is-integer", // no ie11,
"core-js/library/fn/array/from" // no ie11
];
const allowedModules = require("./allowedModules");

module.exports = {
"env": {
Expand Down Expand Up @@ -45,25 +38,10 @@ module.exports = {
"no-undef": "off",
"no-useless-escape": "off",
},
"overrides": [{
"files": "modules/**/*.js",
"overrides": Object.keys(allowedModules).map((key) => ({
"files": key + "/**/*.js",
"rules": {
"prebid/validate-imports": ["error", [
...sharedWhiteList,
"jsencrypt",
"crypto-js"
]]
"prebid/validate-imports": ["error", allowedModules[key]]
}
}, {
"files": "src/**/*.js",
"rules": {
"prebid/validate-imports": ["error", [
...sharedWhiteList,
"fun-hooks/no-eval",
"just-clone",
"dlv",
"dset"
]]
}
}]
}))
};
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = {
}
```

Or for Babel 6:
Or for Babel 6 and/or Node v8.6.0 and less:
```javascript
// you must manually install and specify the presets and plugins yourself
options: {
Expand Down Expand Up @@ -112,7 +112,7 @@ prebid.requestBids({
$ cd Prebid.js
$ npm install

*Note:* You need to have `NodeJS` 9.x or greater installed.
*Note:* You need to have `NodeJS` 6.x or greater installed.

*Note:* In the 1.24.0 release of Prebid.js we have transitioned to using gulp 4.0 from using gulp 3.9.1. To compily with gulp's recommended setup for 4.0, you'll need to have `gulp-cli` installed globally prior to running the general `npm install`. This shouldn't impact any other projects you may work on that use an earlier version of gulp in it's setup.

Expand Down
24 changes: 24 additions & 0 deletions allowedModules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

const sharedWhiteList = [
"core-js/library/fn/array/find", // no ie11
"core-js/library/fn/array/includes", // no ie11
"core-js/library/fn/set", // ie11 supports Set but not Set#values
"core-js/library/fn/string/includes", // no ie11
"core-js/library/fn/number/is-integer", // no ie11,
"core-js/library/fn/array/from" // no ie11
];

module.exports = {
'modules': [
...sharedWhiteList,
'jsencrypt',
'crypto-js'
],
'src': [
...sharedWhiteList,
'fun-hooks/no-eval',
'just-clone',
'dlv',
'dset'
]
};
20 changes: 16 additions & 4 deletions modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const spec = {
* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function (bid) {
const sizes = getSize(bid.sizes);
const sizes = getSize(getSizeArray(bid));
if (!bid.params || !bid.params.placement || !sizes.width || !sizes.height) {
return false;
}
Expand All @@ -34,12 +34,14 @@ export const spec = {
const payload = {
Version: VERSION,
Bids: bidRequests.reduce((accumulator, bid) => {
let size = getSize(bid.sizes);
let sizesArray = getSizeArray(bid);
let size = getSize(sizesArray);
accumulator[bid.bidId] = {};
accumulator[bid.bidId].PlacementID = bid.params.placement;
accumulator[bid.bidId].TransactionID = bid.transactionId;
accumulator[bid.bidId].Width = size.width;
accumulator[bid.bidId].Height = size.height;
accumulator[bid.bidId].AvaiableSizes = sizesArray.join(',');
return accumulator;
}, {}),
PageRefreshed: getPageRefreshed()
Expand Down Expand Up @@ -156,10 +158,20 @@ function createEndpointQS(bidderRequest) {
return qs;
}

function getSizeArray(bid) {
let inputSize = bid.sizes;
if (bid.mediaTypes && bid.mediaTypes.banner) {
inputSize = bid.mediaTypes.banner.sizes;
}

return utils.parseSizesInput(inputSize);
}

/* Get parsed size from request size */
function getSize(requestSizes) {
function getSize(sizesArray) {
const parsed = {};
const size = utils.parseSizesInput(requestSizes)[0];
// the main requested size is the first one
const size = sizesArray[0];

if (typeof size !== 'string') {
return parsed;
Expand Down
11 changes: 3 additions & 8 deletions modules/cedatoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,10 @@ export const spec = {

getUserSyncs: function(syncOptions, resps, gdprConsent) {
const syncs = [];
if (syncOptions.pixelEnabled) {
resps.forEach(() => {
syncs.push(getSync('image', gdprConsent));
});
}
if (syncOptions.iframeEnabled) {
resps.forEach(() => {
syncs.push(getSync('iframe', gdprConsent));
});
syncs.push(getSync('iframe', gdprConsent));
} else if (syncOptions.pixelEnabled) {
syncs.push(getSync('image', gdprConsent));
}
return syncs;
}
Expand Down
Loading

0 comments on commit 84b6e09

Please sign in to comment.