@ninetailed/experience.js 2.0.0-beta.7 → 2.0.0-beta.8

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.esm.js CHANGED
@@ -4619,8 +4619,15 @@ const selectVariant = ({
4619
4619
 
4620
4620
 
4621
4621
  if (experience.type === 'nt_personalization') {
4622
- // TODO check holdout
4623
- // Personalization Expriences can have only one variant.
4622
+ const trafficRandom = getTrafficRandom(profile, experience);
4623
+
4624
+ if (1 - experience.trafficAllocation > trafficRandom) {
4625
+ return Object.assign(Object.assign({}, baseline), {
4626
+ hidden: false
4627
+ });
4628
+ } // Personalization Expriences can have only one variant.
4629
+
4630
+
4624
4631
  return variants[0];
4625
4632
  }
4626
4633
 
package/index.umd.js CHANGED
@@ -4528,8 +4528,15 @@
4528
4528
 
4529
4529
 
4530
4530
  if (experience.type === 'nt_personalization') {
4531
- // TODO check holdout
4532
- // Personalization Expriences can have only one variant.
4531
+ var trafficRandom = getTrafficRandom(profile, experience);
4532
+
4533
+ if (1 - experience.trafficAllocation > trafficRandom) {
4534
+ return __assign(__assign({}, baseline), {
4535
+ hidden: false
4536
+ });
4537
+ } // Personalization Expriences can have only one variant.
4538
+
4539
+
4533
4540
  return variants[0];
4534
4541
  }
4535
4542
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js",
3
- "version": "2.0.0-beta.7",
3
+ "version": "2.0.0-beta.8",
4
4
  "main": "./index.umd.js",
5
5
  "module": "./index.esm.js",
6
6
  "typings": "./index.d.ts",
7
7
  "dependencies": {
8
8
  "analytics": "^0.8.0",
9
- "@ninetailed/experience.js-shared": "2.0.0-beta.7",
9
+ "@ninetailed/experience.js-shared": "2.0.0-beta.8",
10
10
  "uuid": "^8.3.2",
11
11
  "ts-toolbelt": "^9.6.0",
12
12
  "locale-enum": "^1.1.1",