1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/ui/lib/feature-toggle-utils.js
2017-10-10 14:16:57 -07:00

12 lines
392 B
JavaScript

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,
}