Simplify
This commit is contained in:
parent
e2a4335937
commit
58a65856aa
@ -4,8 +4,9 @@ import { readdirSync, statSync } from 'fs';
|
|||||||
import type { RequestHandler } from './$types';
|
import type { RequestHandler } from './$types';
|
||||||
|
|
||||||
export const GET: RequestHandler = () => {
|
export const GET: RequestHandler = () => {
|
||||||
let names = readdirSync(storagePath).filter((f) => statSync(`${storagePath}/${f}`).isDirectory());
|
const names = readdirSync(storagePath)
|
||||||
names = names.toSorted();
|
.filter((f) => statSync(`${storagePath}/${f}`).isDirectory())
|
||||||
|
.toSorted();
|
||||||
|
|
||||||
return json(names);
|
return json(names);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user