Comparing version 1.2.0 to 1.2.1
10
index.js
@@ -6,2 +6,10 @@ 'use strict' | ||
const getValue = (env, secrets, key) => { | ||
const value = `${env[key]}` | ||
if (value.indexOf('@') !== 0) return value | ||
const secret = secrets[env[key]] | ||
if (secret !== undefined) return secret | ||
return secrets[env[key].slice(1)] | ||
} | ||
const applyEnv = (env, secrets) => { | ||
@@ -11,3 +19,3 @@ for (const key in env) { | ||
if (!process.env[key]) { | ||
const value = secrets[env[key]] || secrets[env[key].slice(1)] || env[key] | ||
const value = getValue(env, secrets, key) | ||
process.env[key] = value | ||
@@ -14,0 +22,0 @@ } |
{ | ||
"name": "now-env", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Use now.sh environment variables in development", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4671
60