1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 02:58:09 +01:00
metamask-extension/ui/lib/feature-toggle-utils.js

12 lines
392 B
JavaScript
Raw Normal View History

2017-10-10 23:16:57 +02:00
function checkFeatureToggle (name) {
2017-10-06 04:34:01 +02:00
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,
2017-10-10 23:16:57 +02:00
}