From 6333a2bac783cd82b8ec1f68f1d6fbab3729e526 Mon Sep 17 00:00:00 2001 From: waltem01 Date: Fri, 15 Mar 2024 07:30:10 +0100 Subject: [PATCH] fixup: better typing --- Webserver/src/routes/api/reddit/+server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Webserver/src/routes/api/reddit/+server.ts b/Webserver/src/routes/api/reddit/+server.ts index ce6d780..b7d5b49 100644 --- a/Webserver/src/routes/api/reddit/+server.ts +++ b/Webserver/src/routes/api/reddit/+server.ts @@ -19,8 +19,8 @@ export const GET: RequestHandler = async ({ url }) => { // Get all sources of posts const regex = /]+role="presentation"[^>]+src="(.*?)"[^>]*>/g; - let results = [], - match; + const results: string[] = []; + let match: RegExpExecArray | null; while ((match = regex.exec(text)) !== null) results.push(match[1]); // Return source data