Skip to content

Commit

Permalink
instance of Map check
Browse files Browse the repository at this point in the history
  • Loading branch information
mkomorski committed Nov 8, 2024
1 parent a10a0d8 commit bee9b4a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ export function syncOrtb2(adUnit, mediaType) {
'banner': ORTB_BANNER_PARAMS
}[mediaType];

if (!fields) {
if (!fields && fields instanceof Map) {
return;
}

const params = fields.entries?.() || [];

params.forEach(([key, validator]) => {
fields.entries().forEach(([key, validator]) => {
const mediaTypesFieldValue = deepAccess(adUnit, `mediaTypes.${mediaType}.${key}`);
const ortbFieldValue = deepAccess(adUnit, `ortb2Imp.${mediaType}.${key}`);

Expand Down

0 comments on commit bee9b4a

Please sign in to comment.