aboutsummaryrefslogblamecommitdiffstats
path: root/ui/lib/feature-toggle-utils.js
blob: 6d4e461cad9d6d7879960e75c97075e02910fe5f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                    








                                                                                
 
function checkFeatureToggle (name) {
  const queryPairMap = window.location.search.substr(1).split('&')
    .map(pair => pair.split('='))
    .reduce((pairs, [key, value]) => ({...pairs, [key]: value }), {})
  const featureToggles = queryPairMap['ft'] ? queryPairMap['ft'].split(',') : []
  return Boolean(featureToggles.find(ft => ft === name))
}

module.exports = {
  checkFeatureToggle,
}