From 989114692fcd5e47f673e4af25b42409606effa0 Mon Sep 17 00:00:00 2001
From: ctaepper <ctaepper@users.noreply.github.com>
Date: Fri, 26 Jan 2018 05:26:49 +0100
Subject: [PATCH] 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.
---
 lib/manager/npm/registry.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/manager/npm/registry.js b/lib/manager/npm/registry.js
index 1a5aeca088..cc600e2b81 100644
--- a/lib/manager/npm/registry.js
+++ b/lib/manager/npm/registry.js
@@ -48,6 +48,11 @@ function setNpmrc(input, exposeEnv = false) {
 }
 
 function envReplace(value, env = process.env) {
+  // istanbul ignore if
+  if (typeof value !== 'string' || !value) {
+    return value;
+  }
+
   const ENV_EXPR = /(\\*)\$\{([^}]+)\}/g;
 
   return value.replace(ENV_EXPR, (match, esc, envVarName) => {
-- 
GitLab