From 8b6c5aa30fb41fb014fff97ab9a8317872f6cd2c Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Sat, 22 Feb 2020 07:12:50 +0100
Subject: [PATCH] chore: lgtm lint

---
 lib/datasource/docker/index.ts                  | 14 +++++++-------
 lib/versioning/npm/range.ts                     |  2 +-
 lib/workers/repository/extract/manager-files.ts |  3 ++-
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/lib/datasource/docker/index.ts b/lib/datasource/docker/index.ts
index 2ca7ef8900..e7e96a36ed 100644
--- a/lib/datasource/docker/index.ts
+++ b/lib/datasource/docker/index.ts
@@ -425,13 +425,13 @@ export function getConfigResponseBeforeRedirectHook(options: any): void {
     delete options.headers.authorization;
   }
 
-  if (
-    options.href?.includes('blob.core.windows.net') &&
-    options.headers?.authorization
-  ) {
-    // docker registry is hosted on Azure blob, redirect url includes authentication.
-    // eslint-disable-next-line no-param-reassign
-    delete options.headers.authorization;
+  if (options.href && options.headers?.authorization) {
+    const { host } = URL.parse(options.href);
+    if (host && host.endsWith('blob.core.windows.net')) {
+      // docker registry is hosted on Azure blob, redirect url includes authentication.
+      // eslint-disable-next-line no-param-reassign
+      delete options.headers.authorization;
+    }
   }
 }
 
diff --git a/lib/versioning/npm/range.ts b/lib/versioning/npm/range.ts
index 94bfeb21ee..2e0428ef4a 100644
--- a/lib/versioning/npm/range.ts
+++ b/lib/versioning/npm/range.ts
@@ -173,7 +173,7 @@ export function getNewValue({
       res = `<${toVersionMajor + 1}`;
     }
     if (currentValue.includes('< ')) {
-      res = res.replace('<', '< ');
+      res = res.replace(/</g, '< ');
     }
     return res;
   }
diff --git a/lib/workers/repository/extract/manager-files.ts b/lib/workers/repository/extract/manager-files.ts
index 8cc0354b42..9c01a60578 100644
--- a/lib/workers/repository/extract/manager-files.ts
+++ b/lib/workers/repository/extract/manager-files.ts
@@ -1,3 +1,4 @@
+import is from '@sindresorhus/is';
 import {
   extractAllPackageFiles,
   extractPackageFile,
@@ -24,7 +25,7 @@ export async function getManagerPackageFiles(config): Promise<PackageFile[]> {
   fileList = filterIgnoredFiles(fileList, ignorePaths);
   const matchedFiles = getMatchingFiles(fileList, manager, config.fileMatch);
   // istanbul ignore else
-  if (matchedFiles && matchedFiles.length) {
+  if (is.nonEmptyArray(matchedFiles)) {
     logger.debug(
       `Matched ${
         matchedFiles.length
-- 
GitLab