Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils.js « experimentation « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d3e7800f643d3615083d869e276a833582cb4667 (plain)
1
2
3
4
5
6
7
8
9
10
// This file only applies to use of experiments through https://gitlab.com/gitlab-org/gitlab-experiment
import { get } from 'lodash';

export function getExperimentData(experimentName) {
  return get(window, ['gon', 'experiment', experimentName]);
}

export function isExperimentVariant(experimentName, variantName) {
  return getExperimentData(experimentName)?.variant === variantName;
}