g2-ops-config
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -47,7 +47,13 @@ 'use strict'; | ||
function injectProcessEnv(response) { | ||
Object.keys(response).forEach(function (key) { | ||
if (key.startsWith('ENV-') && typeof response[key] === 'string') { | ||
process.env[key.substring(key.indexOf('ENV-') + 4)] = response[key]; | ||
} | ||
}); | ||
if (response['ENV']) { | ||
Object.keys(response['ENV']).forEach(function (key) { | ||
process.env[key] = response['ENV'][key]; | ||
}); | ||
} else { | ||
Object.keys(response).forEach(function (key) { | ||
if (key.startsWith('ENV-') && typeof response[key] === 'string') { | ||
process.env[key.substring(key.indexOf('ENV-') + 4)] = response[key]; | ||
} | ||
}); | ||
} | ||
} | ||
@@ -54,0 +60,0 @@ |
{ | ||
"name": "g2-ops-config", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "To fetch and maintain cloud configs for difference projects", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -37,8 +37,14 @@ // @flow | ||
function injectProcessEnv(response: { [string]: mixed }) { | ||
Object.keys(response).forEach(key => { | ||
if (key.startsWith('ENV-') && typeof response[key] === 'string') { | ||
process.env[key.substring(key.indexOf('ENV-') + 4)] = response[key] | ||
} | ||
}) | ||
function injectProcessEnv(response: { [string]: string | { [string]: mixed } }) { | ||
if (response['ENV']) { | ||
Object.keys(response['ENV']).forEach(key => { | ||
process.env[key] = response['ENV'][key] | ||
}) | ||
} else { | ||
Object.keys(response).forEach(key => { | ||
if (key.startsWith('ENV-') && typeof response[key] === 'string') { | ||
process.env[key.substring(key.indexOf('ENV-') + 4)] = response[key] | ||
} | ||
}) | ||
} | ||
} | ||
@@ -45,0 +51,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
24606
647
17