diff options
author | Dan <danjm.com@gmail.com> | 2017-10-06 10:34:01 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-09 08:48:09 +0800 |
commit | 49f76d27a9967cbeff0ba5b3d41277c558999472 (patch) | |
tree | 33acbd312cdb634ef3b2e7c22336d7404dc912ca /ui/lib | |
parent | bbe893a0d8d759ba750ba78ff8aed0f0876a43ff (diff) | |
download | tangerine-wallet-browser-49f76d27a9967cbeff0ba5b3d41277c558999472.tar tangerine-wallet-browser-49f76d27a9967cbeff0ba5b3d41277c558999472.tar.gz tangerine-wallet-browser-49f76d27a9967cbeff0ba5b3d41277c558999472.tar.bz2 tangerine-wallet-browser-49f76d27a9967cbeff0ba5b3d41277c558999472.tar.lz tangerine-wallet-browser-49f76d27a9967cbeff0ba5b3d41277c558999472.tar.xz tangerine-wallet-browser-49f76d27a9967cbeff0ba5b3d41277c558999472.tar.zst tangerine-wallet-browser-49f76d27a9967cbeff0ba5b3d41277c558999472.zip |
Adds checkFeatureToggle util.
Diffstat (limited to 'ui/lib')
-rw-r--r-- | ui/lib/feature-toggle-utils.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/lib/feature-toggle-utils.js b/ui/lib/feature-toggle-utils.js new file mode 100644 index 000000000..f4ff446d3 --- /dev/null +++ b/ui/lib/feature-toggle-utils.js @@ -0,0 +1,11 @@ +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, +}
\ No newline at end of file |