@ninetailed/experience.js-utils-contentful
Advanced tools
Comparing version 2.0.0-beta.6 to 2.0.0-beta.7
{ | ||
"name": "@ninetailed/experience.js-utils-contentful", | ||
"version": "2.0.0-beta.6", | ||
"version": "2.0.0-beta.7", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -12,3 +12,3 @@ "use strict"; | ||
const _mapVariant = (options === null || options === void 0 ? void 0 : options.mapVariant) || defaultMapVariant; | ||
const config = Object.assign({ traffic: 0, scatteredDistribution: [{ index: 0, start: 0, end: 1 }], components: [ | ||
const config = Object.assign({ traffic: 0, distribution: [0.5, 0.5], components: [ | ||
{ | ||
@@ -24,3 +24,7 @@ baseline: { id: '' }, | ||
} | ||
: {})), { trafficAllocation: config.traffic, distribution: config.scatteredDistribution, components: config.components.map((component) => { | ||
: {})), { trafficAllocation: config.traffic, distribution: config.distribution.map((percentage, index) => ({ | ||
index, | ||
start: config.distribution.slice(0, index).reduce((a, b) => a + b, 0), | ||
end: config.distribution.slice(0, index + 1).reduce((a, b) => a + b, 0), | ||
})), components: config.components.map((component) => { | ||
return { | ||
@@ -27,0 +31,0 @@ baseline: _mapBaseline(baseline), |
Sorry, the diff of this file is not supported yet
12675
168