UNPKG

@didomi/iabtcf-cmpapi

Version:

Ensures other in-page digital marketing technologies have access to CMP transparency and consent information for the iab. Transparency and Consent Framework (TCF).

1 lines 1.12 kB
"use strict";var __read=this&&this.__read||function(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var a,c,o=t.call(e),i=[];try{for(;(void 0===r||r-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(e){c={error:e}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(c)throw c.error}}return i},__spreadArray=this&&this.__spreadArray||function(e,r,t){if(t||2===arguments.length)for(var a,c=0,o=r.length;c<o;c++)!a&&c in r||(a||(a=Array.prototype.slice.call(r,0,c)),a[c]=r[c]);return e.concat(a||Array.prototype.slice.call(r))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CacheBucket=void 0;var CacheBucket=function(){function e(e){this.name=e,this.recalculations=0,this.cache=new Map}return e.prototype.get=function(e,r){for(var t=[],a=2;a<arguments.length;a++)t[a-2]=arguments[a];var c=this.cache.get(e);return c||(c=r.apply(void 0,__spreadArray([],__read(t),!1)),this.cache.set(e,c),this.recalculations++,c)},e.prototype.clear=function(){this.cache.clear(),this.recalculations=0},e.prototype.size=function(){return this.cache.size},e}();exports.CacheBucket=CacheBucket;