File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -14,10 +14,25 @@ export {
1414} ;
1515
1616const metadata = require ( '../../metadata.json' ) ;
17- const EU_LANGUAGE_CODES = new Set ( metadata . languageCodes ) ;
18- const EU_COUNTRY_CODES = new Set ( metadata . countryCodes ) ;
1917const MAX_COOKIE_LIFESPAN_DAYS = metadata . maxCookieLifespanDays ;
2018const CONSENT_PROPS = [ 'purposeConsents' , 'vendorConsents' , 'customPurposes' , 'standardPurposes' ] ;
19+ const EU_LANGUAGE_CODES = new Set ( metadata . languageCodes ) ;
20+ const EU_COUNTRY_CODES = new Set ( metadata . countryCodes ) ;
21+
22+ // Necessary because IE11 doesn't support init'ing a Set with values
23+ function initConstants ( ) {
24+ if ( EU_COUNTRY_CODES . size === 0 ) {
25+ for ( var i in metadata . countryCodes ) {
26+ EU_COUNTRY_CODES . add ( metadata . countryCodes [ i ] ) ;
27+ }
28+ for ( var j in metadata . languageCodes ) {
29+ EU_LANGUAGE_CODES . add ( metadata . languageCodes [ j ] ) ;
30+ }
31+ }
32+ }
33+
34+ initConstants ( ) ;
35+
2136
2237function getConsentsCount ( consentObject , vendorList ) {
2338 let total = 0 ;
You can’t perform that action at this time.
0 commit comments