refactor: eliminate any types across server and TTS worker
- app.ts: type serveFile context parameter as Hono Context - bets.ts: replace catch(err: any) with err: unknown + narrowing - fight-loop.ts: type pickMatchup style as union literal, replace as any casts with proper result type - tts-worker.ts: import KokoroTTS type, use ProgressInfo inference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
1ca8a6feb0
commit
010e18fbd3
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { Hono } from 'hono'
|
||||
import { Hono, type Context } from 'hono'
|
||||
import { cors } from 'hono/cors'
|
||||
import { logger } from 'hono/logger'
|
||||
import { secureHeaders } from 'hono/secure-headers'
|
||||
@@ -79,7 +79,7 @@ if (process.env.NODE_ENV === 'production' && existsSync(publicDir)) {
|
||||
webmanifest: 'application/manifest+json',
|
||||
}
|
||||
|
||||
function serveFile(c: any, reqPath: string, cacheControl: string) {
|
||||
function serveFile(c: Context, reqPath: string, cacheControl: string) {
|
||||
const resolved = join(publicDir, reqPath)
|
||||
// Prevent path traversal
|
||||
if (!resolved.startsWith(publicDir)) return c.notFound()
|
||||
|
||||
Reference in New Issue
Block a user