summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/experimentation/utils.js
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;
}