Created
November 8, 2019 22:58
-
-
Save brunoluiz/b8ca5236ff6a095801422604d68d6e30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const matcher = /^(CONFIG_|REACT_APP).*$/g; | |
const replacer = /(CONFIG_|REACT_APP)/g; | |
const pconfigs = Object.keys(process.env).reduce((acc, key) => { | |
if (!key.match(matcher)) { | |
return acc; | |
} | |
const k = key.replace(replacer, ''); | |
return { ...acc, [k]: process.env[key] }; | |
}, {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment