From e23244ddfa3db6a5f7fba17f83b47a9d0eceba1d Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Fri, 25 Jun 2021 18:02:14 +0200 Subject: [PATCH 1/2] Check for strings instead of errors FetchError subclasses Error, but detecting it would be a pain --- src/drivers/gitlab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/gitlab.js b/src/drivers/gitlab.js index 0ecdb429e..b9fca56fb 100644 --- a/src/drivers/gitlab.js +++ b/src/drivers/gitlab.js @@ -60,7 +60,7 @@ class Gitlab { ); this.detectedBase = possibleBases.find( - (base) => base.constructor !== Error + (base) => typeof base === 'string' ); if (!this.detectedBase) { if (possibleBases.length) throw possibleBases[0]; From fb9e082f85d682aeae0ebd28b2205a14989a6734 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 25 Jun 2021 16:18:57 +0000 Subject: [PATCH 2/2] Restyled by prettier --- src/drivers/gitlab.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/drivers/gitlab.js b/src/drivers/gitlab.js index b9fca56fb..bfe4b94dc 100644 --- a/src/drivers/gitlab.js +++ b/src/drivers/gitlab.js @@ -59,9 +59,7 @@ class Gitlab { }) ); - this.detectedBase = possibleBases.find( - (base) => typeof base === 'string' - ); + this.detectedBase = possibleBases.find((base) => typeof base === 'string'); if (!this.detectedBase) { if (possibleBases.length) throw possibleBases[0]; throw new Error('Invalid repository address');