From cde28c8d2a054da8abd15847be5efe6054bbc80b Mon Sep 17 00:00:00 2001 From: eknis Date: Mon, 7 Jul 2025 16:25:38 +0900 Subject: [PATCH] im-rtd-provider remove biddder function --- modules/imRtdProvider.js | 35 --------------- test/spec/modules/imRtdProvider_spec.js | 57 ------------------------- 2 files changed, 92 deletions(-) diff --git a/modules/imRtdProvider.js b/modules/imRtdProvider.js index 46573a81c15..454ee10624e 100644 --- a/modules/imRtdProvider.js +++ b/modules/imRtdProvider.js @@ -53,38 +53,6 @@ function getSegments(segments, moduleConfig) { return segments.slice(0, maxSegments); } -/** - * @param {string} bidderName - */ -export function getBidderFunction(bidderName) { - const biddersFunction = { - pubmatic: function (bid, data, moduleConfig) { - if (data.im_segments && data.im_segments.length) { - const segments = getSegments(data.im_segments, moduleConfig); - const dctr = deepAccess(bid, 'params.dctr'); - deepSetValue( - bid, - 'params.dctr', - `${dctr ? dctr + '|' : ''}im_segments=${segments.join(',')}` - ); - } - return bid - }, - fluct: function (bid, data, moduleConfig) { - if (data.im_segments && data.im_segments.length) { - const segments = getSegments(data.im_segments, moduleConfig); - deepSetValue( - bid, - 'params.kv.imsids', - segments - ); - } - return bid - } - } - return biddersFunction[bidderName] || null; -} - export function getCustomBidderFunction(config, bidder) { const overwriteFn = deepAccess(config, `params.overwrites.${bidder}`) @@ -122,12 +90,9 @@ export function setRealTimeData(bidConfig, moduleConfig, data) { adUnits.forEach(adUnit => { adUnit.bids.forEach(bid => { - const bidderFunction = getBidderFunction(bid.bidder); const overwriteFunction = getCustomBidderFunction(moduleConfig, bid.bidder); if (overwriteFunction) { overwriteFunction(bid, data, utils, config); - } else if (bidderFunction) { - bidderFunction(bid, data, moduleConfig); } }) }); diff --git a/test/spec/modules/imRtdProvider_spec.js b/test/spec/modules/imRtdProvider_spec.js index 89328b91529..7e1a4639de8 100644 --- a/test/spec/modules/imRtdProvider_spec.js +++ b/test/spec/modules/imRtdProvider_spec.js @@ -1,7 +1,6 @@ import { imRtdSubmodule, storage, - getBidderFunction, getCustomBidderFunction, setRealTimeData, getRealTimeData, @@ -49,62 +48,6 @@ describe('imRtdProvider', function () { }) }) - describe('getBidderFunction', function () { - const assumedBidder = [ - 'pubmatic', - 'fluct' - ]; - assumedBidder.forEach(bidderName => { - it(`should return bidderFunction with assumed bidder: ${bidderName}`, function () { - expect(getBidderFunction(bidderName)).to.exist.and.to.be.a('function'); - }); - - it(`should return bid with correct key data: ${bidderName}`, function () { - const bid = {bidder: bidderName}; - expect(getBidderFunction(bidderName)(bid, {'im_segments': ['12345', '67890']}, {params: {}})).to.equal(bid); - }); - it(`should return bid without data: ${bidderName}`, function () { - const bid = {bidder: bidderName}; - expect(getBidderFunction(bidderName)(bid, '', {params: {}})).to.equal(bid); - }); - }); - it(`should return null with unexpected bidder`, function () { - expect(getBidderFunction('test')).to.equal(null); - }); - describe('fluct bidder function', function () { - it('should return a bid w/o im_segments if not any exists', function () { - const bid = {bidder: 'fluct'}; - expect(getBidderFunction('fluct')(bid, '', {params: {}})).to.eql(bid); - }); - it('should return a bid w/ im_segments if any exists', function () { - const bid = { - bidder: 'fluct', - params: { - kv: { - foo: ['foo1'] - } - } - }; - expect(getBidderFunction('fluct')( - bid, - {im_segments: ['12345', '67890', '09876']}, - {params: {maxSegments: 2}} - )) - .to.eql( - { - bidder: 'fluct', - params: { - kv: { - foo: ['foo1'], - imsids: ['12345', '67890'] - } - } - } - ); - }); - }); - }) - describe('getCustomBidderFunction', function () { it('should return config function', function () { const config = {