From 58a65856aa30079510d91683a10f896fe8e972e2 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sat, 17 Aug 2024 17:22:27 +0200 Subject: [PATCH] Simplify --- src/routes/names/+server.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/names/+server.ts b/src/routes/names/+server.ts index 6c7a633..c4c9aa1 100644 --- a/src/routes/names/+server.ts +++ b/src/routes/names/+server.ts @@ -4,8 +4,9 @@ import { readdirSync, statSync } from 'fs'; import type { RequestHandler } from './$types'; export const GET: RequestHandler = () => { - let names = readdirSync(storagePath).filter((f) => statSync(`${storagePath}/${f}`).isDirectory()); - names = names.toSorted(); + const names = readdirSync(storagePath) + .filter((f) => statSync(`${storagePath}/${f}`).isDirectory()) + .toSorted(); return json(names); };