modules/pulsepointBidAdapter.js
function nativeResponse(imp, bid) {
  if (imp['native']) {
    const nativeAd = parse(bid.adm);
    const keys = {};
    if (nativeAd && nativeAd['native'] && nativeAd['native'].assets) {
      nativeAd['native'].assets.forEach(asset => {
        keys.title = asset.title ? asset.title.text : keys.title;
        keys.body = asset.data && asset.data.type === 2 ? asset.data.value : keys.body;
        keys.sponsoredBy = asset.data && asset.data.type === 1 ? asset.data.value : keys.sponsoredBy;
        keys.image = asset.img && asset.img.type === 3 ? asset.img.url : keys.image;
        keys.icon = asset.img && asset.img.type === 1 ? asset.img.url : keys.icon;
      });
      if (nativeAd['native'].link) {
        keys.clickUrl = encodeURIComponent(nativeAd['native'].link.url);
      }
      keys.impressionTrackers = nativeAd['native'].imptrackers;
      return keys;
    }
  }
  return null;
}
function nativeResponse(imp, bid) {
  if (imp['native']) {
    const nativeAd = parse(bid.adm);
    const keys = {};
    if (nativeAd && nativeAd['native'] && nativeAd['native'].assets) {
      nativeAd['native'].assets.forEach(asset => {
        keys.title = asset.title ? asset.title.text : keys.title;
        keys.body = asset.data && asset.data.type === 2 ? asset.data.value : keys.body;
        keys.sponsoredBy = asset.data && asset.data.type === 1 ? asset.data.value : keys.sponsoredBy;
        keys.image = asset.img && asset.img.type === 3 ? asset.img.url : keys.image;
        keys.icon = asset.img && asset.img.type === 1 ? asset.img.url : keys.icon;
      });
      if (nativeAd['native'].link) {
        keys.clickUrl = encodeURIComponent(nativeAd['native'].link.url);
      }
      keys.impressionTrackers = nativeAd['native'].imptrackers;
      return keys;
    }
  }
  return null;
}
function nativeResponse ( imp , bid ) { if ( imp [ 'native' ] ) { const nativeAd = parse ( bid . adm ) ; const keys = { } ; if ( nativeAd && nativeAd [ 'native' ] && nativeAd [ 'native' ] . assets ) { nativeAd [ 'native' ] . assets . forEach ( asset => { keys . title = asset . title ? asset . title . text : keys . title ; keys . body = asset . data && asset . data . type === 2 ? asset . data . value : keys . body ; keys . sponsoredBy = asset . data && asset . data . type === 1 ? asset . data . value : keys . sponsoredBy ; keys . image = asset . img && asset . img . type === 3 ? asset . img . url : keys . image ; keys . icon = asset . img && asset . img . type === 1 ? asset . img . url : keys . icon ; } ) ; if ( nativeAd [ 'native' ] . link ) { keys . clickUrl = encodeURIComponent ( nativeAd [ 'native' ] . link . url ) ; } keys . impressionTrackers = nativeAd [ 'native' ] . imptrackers ; return keys ; } } return null ; }
Parses the native response from the Bid given.
Parses the native response from the Bid given .