Fix indents

This commit is contained in:
yumeko 2023-07-27 12:54:42 +03:00
parent a4838c7ee4
commit 72d194f7a1
No known key found for this signature in database
GPG key ID: 31A48AD2758B1B53

View file

@ -37,7 +37,7 @@ import { deleteFile } from "./delete-file.js";
const logger = driveLogger.createSubLogger("register", "yellow"); 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. // 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. // Null or 0-length parts will be left out.
@ -52,15 +52,13 @@ function urlPathJoin(
url.pathname.endsWith("/") ? url.pathname.slice(0, -1) : url.pathname, url.pathname.endsWith("/") ? url.pathname.slice(0, -1) : url.pathname,
); );
url.pathname = pathParts url.pathname = pathParts
.filter((x) => x !== null && x.toString().length > 0) .filter((x) => x !== null && x.toString().length > 0).join("/");
.join("/");
} }
return url.toString(); return url.toString();
} }
const baseParts = baseOrParts.concat(pathParts ?? []); const baseParts = baseOrParts.concat(pathParts ?? []);
return baseParts return baseParts
.filter((x) => x !== null && x.toString().length > 0) .filter((x) => x !== null && x.toString().length > 0).join("/");
.join("/");
} }
/*** /***