Created
April 23, 2019 20:14
-
-
Save jonstuebe/af4bba71bb5413a5420035d880103050 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 postmanEnv = { | |
"id": "7a40704a-d4e2-4948-ba35-826a93f2bf0f", | |
"name": "local", | |
"values": [ | |
// values would go here | |
], | |
"_postman_variable_scope": "environment", | |
"_postman_exported_at": "2019-04-23T18:36:01.716Z", | |
"_postman_exported_using": "Postman/7.0.9" | |
}; | |
const env = postmanEnv.values.reduce((acc, {key, value}) => { | |
if(acc.value) { | |
return { [key]: value }; | |
} | |
return { ...acc, [key]: value } | |
}); | |
console.log(JSON.stringify(env)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment