From d60bea22792b5fb39f50a54e073727630f33daad Mon Sep 17 00:00:00 2001 From: ytshih Date: Tue, 15 Oct 2024 12:54:24 +0000 Subject: [PATCH] Fix: indents --- index.ts | 4 ++-- pages/repo.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/index.ts b/index.ts index 7d86e7c..8483c52 100644 --- a/index.ts +++ b/index.ts @@ -10,8 +10,8 @@ async function loadPages(): Promise { try { const pagesPath = path.join(__dirname, './pages'); const pagesFiles = path.basename(__filename).endsWith('.ts') - ? (await readdir(pagesPath)).filter(file => file.endsWith('.ts')) - : (await readdir(pagesPath)).filter(file => file.endsWith('.js')); + ? (await readdir(pagesPath)).filter(file => file.endsWith('.ts')) + : (await readdir(pagesPath)).filter(file => file.endsWith('.js')); for (const file of pagesFiles) { const filePath = path.join(pagesPath, file); const data = await import(filePath); diff --git a/pages/repo.ts b/pages/repo.ts index 76913f2..fe08223 100644 --- a/pages/repo.ts +++ b/pages/repo.ts @@ -29,14 +29,14 @@ class Repo extends Page{ res.set({ 'Content-Type': 'application/octet-stream' }); - await new Promise((resolve, reject) => { - fileStream.pipe(res); - fileStream.on('end', () => { - console.log(`Response with ${file}`); - resolve(); - }); - }); - } catch(err: unknown) { + await new Promise((resolve, reject) => { + fileStream.pipe(res); + fileStream.on('end', () => { + console.log(`Response with ${file}`); + resolve(); + }); + }); + } catch(err: unknown) { if (err instanceof URIError) { res.status(404).send(String(err)); return;