From 52ef2d8d32bbe31de219bfc0b5dfeea3103b82d7 Mon Sep 17 00:00:00 2001 From: nivedin Date: Fri, 29 Dec 2023 19:54:13 +0530 Subject: [PATCH] fix: remove redundant array creation --- .../src/helpers/teams/TeamCollectionAdapter.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/hoppscotch-common/src/helpers/teams/TeamCollectionAdapter.ts b/packages/hoppscotch-common/src/helpers/teams/TeamCollectionAdapter.ts index dfddae15f..5cda13eaa 100644 --- a/packages/hoppscotch-common/src/helpers/teams/TeamCollectionAdapter.ts +++ b/packages/hoppscotch-common/src/helpers/teams/TeamCollectionAdapter.ts @@ -1085,7 +1085,7 @@ export default class NewTeamCollectionAdapter { authType: "inherit", authActive: true, } - auth.parentID = [...path.slice(0, i + 1)].join("/") + auth.parentID = path.slice(0, i + 1).join("/") auth.parentName = parentFolder.title } @@ -1096,10 +1096,10 @@ export default class NewTeamCollectionAdapter { if ( parentFolderAuth?.authType === "inherit" && - [...path.slice(0, i + 1)].length === 1 + path.slice(0, i + 1).length === 1 ) { auth = { - parentID: [...path.slice(0, i + 1)].join("/"), + parentID: path.slice(0, i + 1).join("/"), parentName: parentFolder.title, inheritedAuth: auth.inheritedAuth, } @@ -1107,7 +1107,7 @@ export default class NewTeamCollectionAdapter { if (parentFolderAuth?.authType !== "inherit") { auth = { - parentID: [...path.slice(0, i + 1)].join("/"), + parentID: path.slice(0, i + 1).join("/"), parentName: parentFolder.title, inheritedAuth: parentFolderAuth, } @@ -1120,7 +1120,7 @@ export default class NewTeamCollectionAdapter { const index = headers.findIndex( (h) => h.inheritedHeader?.key === header.key ) - const currentPath = [...path.slice(0, i + 1)].join("/") + const currentPath = path.slice(0, i + 1).join("/") if (index !== -1) { // Replace the existing header with the same key headers[index] = {