From 0a8ceb9e6349284e75545a01ffad608b020f78e2 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Mon, 11 Dec 2023 01:12:54 +0100 Subject: Actually run prettier --- src/cdn/util/FileStorage.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/cdn/util/FileStorage.ts') diff --git a/src/cdn/util/FileStorage.ts b/src/cdn/util/FileStorage.ts index 10b36743..5e53081b 100644 --- a/src/cdn/util/FileStorage.ts +++ b/src/cdn/util/FileStorage.ts @@ -30,8 +30,7 @@ function getPath(path: string) { const root = process.env.STORAGE_LOCATION || "../"; const filename = join(root, path); - if (path.indexOf("\0") !== -1 || !filename.startsWith(root)) - throw new Error("invalid path"); + if (path.indexOf("\0") !== -1 || !filename.startsWith(root)) throw new Error("invalid path"); return filename; } @@ -53,8 +52,7 @@ export class FileStorage implements Storage { async set(path: string, value: Buffer) { path = getPath(path); - if (!fs.existsSync(dirname(path))) - fs.mkdirSync(dirname(path), { recursive: true }); + if (!fs.existsSync(dirname(path))) fs.mkdirSync(dirname(path), { recursive: true }); const ret = Readable.from(value); const cleaned_file = fs.createWriteStream(path); -- cgit 1.5.1