@haibun/core
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -8,2 +8,3 @@ "use strict"; | ||
const TYPE_CREDENTIAL = 'c_'; | ||
const TYPE_ENV = 'e_'; | ||
const TYPE_VAR = 'b_'; | ||
@@ -16,4 +17,5 @@ // from source or literal | ||
const b = `\`(?<${TYPE_VAR}${num}>.+)\``; // var | ||
const e = `\{(?<${TYPE_ENV}${num}>.+)\}`; // var | ||
const t = `(?<${TYPE_VAR_OR_LITERAL}${num}>.+)`; // var or literal | ||
return `(${q}|${c}|${b}|${t})`; | ||
return `(${q}|${c}|${e}|${b}|${t})`; | ||
}; | ||
@@ -97,2 +99,10 @@ exports.matchGroups = matchGroups; | ||
} | ||
else if (namedKey.startsWith(TYPE_ENV)) { | ||
// FIXME add test | ||
const val = process.env[namedValue]; | ||
if (!val) { | ||
throw Error(`no env value for "${namedValue}" from ${JSON.stringify({ shared, type })}`); | ||
} | ||
namedFromVars[name] = val; | ||
} | ||
else if (namedKey.startsWith(TYPE_QUOTED)) { | ||
@@ -99,0 +109,0 @@ // quoted |
{ | ||
"name": "@haibun/core", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
218085
2807
7