@blotoutio/edgetag-sdk-browser 0.26.3 → 0.26.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +13 -10
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
referrer: getReferrer(),
|
|
336
336
|
search: getSearch(),
|
|
337
337
|
locale: getLocale(),
|
|
338
|
-
sdkVersion: "0.26.
|
|
338
|
+
sdkVersion: "0.26.5" ,
|
|
339
339
|
...(payload || {}),
|
|
340
340
|
};
|
|
341
341
|
let storage = {};
|
|
@@ -444,7 +444,7 @@
|
|
|
444
444
|
};
|
|
445
445
|
|
|
446
446
|
const isBool = (v) => typeof v == 'boolean';
|
|
447
|
-
const isRecord = (v) => !!v && typeof v == 'object';
|
|
447
|
+
const isRecord = (v) => !!v && typeof v == 'object' && !Array.isArray(v);
|
|
448
448
|
/**
|
|
449
449
|
* This function validates user consent for a given provider and tag name.
|
|
450
450
|
* It should be used in conjunction with `UserConsent`, not `ProvidersConfig`.
|
|
@@ -478,22 +478,25 @@
|
|
|
478
478
|
if (!isRecord(providersConfig)) {
|
|
479
479
|
return true;
|
|
480
480
|
}
|
|
481
|
-
let allowed = isBool(providersConfig.all) ? providersConfig.all : true;
|
|
482
481
|
if (provider in providersConfig) {
|
|
483
482
|
const providerSpecific = providersConfig[provider];
|
|
484
483
|
if (isBool(providerSpecific)) {
|
|
485
|
-
|
|
484
|
+
return providerSpecific;
|
|
486
485
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
allowed = providerSpecific.all;
|
|
490
|
-
}
|
|
486
|
+
if (isRecord(providerSpecific)) {
|
|
487
|
+
const tagKeys = Object.keys(providerSpecific).filter((k) => k != 'all');
|
|
491
488
|
if (tagName in providerSpecific && isBool(providerSpecific[tagName])) {
|
|
492
|
-
|
|
489
|
+
return providerSpecific[tagName];
|
|
493
490
|
}
|
|
491
|
+
return isBool(providerSpecific.all)
|
|
492
|
+
? providerSpecific.all
|
|
493
|
+
: tagKeys.length == 0;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
|
|
496
|
+
const providerKeys = Object.keys(providersConfig).filter((k) => k != 'all');
|
|
497
|
+
return isBool(providersConfig.all)
|
|
498
|
+
? providersConfig.all
|
|
499
|
+
: providerKeys.length == 0;
|
|
497
500
|
};
|
|
498
501
|
|
|
499
502
|
const upsert = (map, key, update, createDefault) => {
|