( feature: string, evaluation: FeatureEvaluationSnapshot, )
| 348 | } |
| 349 | |
| 350 | function updateExperimentDataForFeature( |
| 351 | feature: string, |
| 352 | evaluation: FeatureEvaluationSnapshot, |
| 353 | ): void { |
| 354 | const canonicalFeature = toCanonicalAnalyticsName(feature) |
| 355 | if ( |
| 356 | evaluation.source !== 'experiment' || |
| 357 | !evaluation.experiment?.key || |
| 358 | evaluation.experimentResult?.variationId === undefined |
| 359 | ) { |
| 360 | experimentDataByFeature.delete(canonicalFeature) |
| 361 | return |
| 362 | } |
| 363 | |
| 364 | experimentDataByFeature.set(canonicalFeature, { |
| 365 | experimentId: evaluation.experiment.key, |
| 366 | variationId: evaluation.experimentResult.variationId, |
| 367 | inExperiment: evaluation.experimentResult.inExperiment, |
| 368 | hashAttribute: evaluation.experimentResult.hashAttribute, |
| 369 | hashValue: evaluation.experimentResult.hashValue, |
| 370 | }) |
| 371 | } |
| 372 | |
| 373 | /** |
| 374 | * Process a GrowthBook payload from the server and populate local caches. |
no test coverage detected