From a50b94afaf3868a3f49bb673c970213c6428b307 Mon Sep 17 00:00:00 2001 From: polatengin Date: Thu, 26 Sep 2024 10:11:56 -0700 Subject: [PATCH 1/2] removing unneeded imports --- app/lib/connection.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/lib/connection.ts b/app/lib/connection.ts index 712b288f..b1b83d2f 100644 --- a/app/lib/connection.ts +++ b/app/lib/connection.ts @@ -1,9 +1,4 @@ -import { BasicCredentialHandler } from "azure-devops-node-api/handlers/basiccreds"; - import url = require("url"); -import apim = require("azure-devops-node-api/WebApi"); -import apibasem = require("azure-devops-node-api/interfaces/common/VsoBaseInterfaces"); -import trace = require("./trace"); export class TfsConnection { private parsedUrl: url.Url; From 637b65f84acebfe874b27d1207cb4c9d3ac48a83 Mon Sep 17 00:00:00 2001 From: polatengin Date: Thu, 26 Sep 2024 10:12:38 -0700 Subject: [PATCH 2/2] handling trailing slashes in service url input --- app/lib/connection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/connection.ts b/app/lib/connection.ts index b1b83d2f..6cd40769 100644 --- a/app/lib/connection.ts +++ b/app/lib/connection.ts @@ -9,7 +9,7 @@ export class TfsConnection { constructor(private serviceUrl: string) { this.parsedUrl = url.parse(this.serviceUrl); - var splitPath: string[] = this.parsedUrl.path.split("/").slice(1); + const splitPath: string[] = this.parsedUrl.path.split("/").slice(1).filter(item => item !== ""); this.accountUrl = this.parsedUrl.protocol + "//" + this.parsedUrl.host; if (splitPath.length === 2 && splitPath[0] === "tfs") {