From 72d194f7a1e47398782c5a23dc6f0a5953b61bfc Mon Sep 17 00:00:00 2001 From: yumeko Date: Thu, 27 Jul 2023 12:54:42 +0300 Subject: [PATCH] Fix indents --- .../backend/src/services/drive/add-file.ts | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/backend/src/services/drive/add-file.ts b/packages/backend/src/services/drive/add-file.ts index 630711cef3..ad2778619f 100644 --- a/packages/backend/src/services/drive/add-file.ts +++ b/packages/backend/src/services/drive/add-file.ts @@ -37,7 +37,7 @@ import { deleteFile } from "./delete-file.js"; const logger = driveLogger.createSubLogger("register", "yellow"); -type PathPartLike = string | null +type PathPartLike = string | null; // Joins an array of elements into a URL pathname, possibly with a base URL object to append to. // Null or 0-length parts will be left out. @@ -46,21 +46,19 @@ function urlPathJoin( pathParts?: PathPartLike[], ): string { if (baseOrParts instanceof URL) { - const url = new URL(baseOrParts as URL); - if (pathParts) { - pathParts.unshift( - url.pathname.endsWith("/") ? url.pathname.slice(0, -1) : url.pathname, - ); - url.pathname = pathParts - .filter((x) => x !== null && x.toString().length > 0) - .join("/"); - } - return url.toString(); + const url = new URL(baseOrParts as URL); + if (pathParts) { + pathParts.unshift( + url.pathname.endsWith("/") ? url.pathname.slice(0, -1) : url.pathname, + ); + url.pathname = pathParts + .filter((x) => x !== null && x.toString().length > 0).join("/"); + } + return url.toString(); } const baseParts = baseOrParts.concat(pathParts ?? []); return baseParts - .filter((x) => x !== null && x.toString().length > 0) - .join("/"); + .filter((x) => x !== null && x.toString().length > 0).join("/"); } /***