@uniformdev/context 20.6.5-alpha.1 → 20.7.1-alpha.14

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/dist/index.esm.js CHANGED
@@ -773,11 +773,11 @@ var testVariations = ({
773
773
  }
774
774
  if (!selectedVariant) {
775
775
  const distributions = normalizeVariationDistributions(variations);
776
- const random = Math.random() * 100;
776
+ const random = Math.floor(Math.random() * 100);
777
777
  let distributionOffset = 0;
778
778
  selectedVariant = variations.find((variant, index) => {
779
779
  const distribution = distributions[index];
780
- if (random >= distributionOffset && random < distributionOffset + distribution) {
780
+ if ((random > distributionOffset || random === 0) && random <= distributionOffset + distribution) {
781
781
  return variant;
782
782
  }
783
783
  distributionOffset += distribution;
package/dist/index.js CHANGED
@@ -862,11 +862,11 @@ var testVariations = ({
862
862
  }
863
863
  if (!selectedVariant) {
864
864
  const distributions = normalizeVariationDistributions(variations);
865
- const random = Math.random() * 100;
865
+ const random = Math.floor(Math.random() * 100);
866
866
  let distributionOffset = 0;
867
867
  selectedVariant = variations.find((variant, index) => {
868
868
  const distribution = distributions[index];
869
- if (random >= distributionOffset && random < distributionOffset + distribution) {
869
+ if ((random > distributionOffset || random === 0) && random <= distributionOffset + distribution) {
870
870
  return variant;
871
871
  }
872
872
  distributionOffset += distribution;
package/dist/index.mjs CHANGED
@@ -773,11 +773,11 @@ var testVariations = ({
773
773
  }
774
774
  if (!selectedVariant) {
775
775
  const distributions = normalizeVariationDistributions(variations);
776
- const random = Math.random() * 100;
776
+ const random = Math.floor(Math.random() * 100);
777
777
  let distributionOffset = 0;
778
778
  selectedVariant = variations.find((variant, index) => {
779
779
  const distribution = distributions[index];
780
- if (random >= distributionOffset && random < distributionOffset + distribution) {
780
+ if ((random > distributionOffset || random === 0) && random <= distributionOffset + distribution) {
781
781
  return variant;
782
782
  }
783
783
  distributionOffset += distribution;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context",
3
- "version": "20.6.5-alpha.1+1b1a069415",
3
+ "version": "20.7.1-alpha.14+60f5dc825c",
4
4
  "description": "Uniform Context core package",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "1b1a06941575fefd19f3ab5621a0c403aa2cf7d5"
71
+ "gitHead": "60f5dc825c94de66d7593877448296c598c3c10d"
72
72
  }