Skip to content
Snippets Groups Projects
Commit 98911469 authored by ctaepper's avatar ctaepper Committed by Rhys Arkins
Browse files

fix: properly handle boolean values in npmrc keys (#1445)

#1407 introduced a bug where the replacement logic breaks if the value of the npmrc key is a boolean.
parent d66dea7e
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,11 @@ function setNpmrc(input, exposeEnv = false) { ...@@ -48,6 +48,11 @@ function setNpmrc(input, exposeEnv = false) {
} }
function envReplace(value, env = process.env) { function envReplace(value, env = process.env) {
// istanbul ignore if
if (typeof value !== 'string' || !value) {
return value;
}
const ENV_EXPR = /(\\*)\$\{([^}]+)\}/g; const ENV_EXPR = /(\\*)\$\{([^}]+)\}/g;
return value.replace(ENV_EXPR, (match, esc, envVarName) => { return value.replace(ENV_EXPR, (match, esc, envVarName) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment