Simplify
This commit is contained in:
parent
e2a4335937
commit
58a65856aa
@ -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);
|
||||
};
|
||||
|
Reference in New Issue
Block a user