From 1d38109dcf7788fdc70c681754e464281ca766cf Mon Sep 17 00:00:00 2001 From: Xrystal Date: Sat, 21 Oct 2023 18:56:51 +0800 Subject: [PATCH] Use JSON instead of json5 --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 542359c37..06e5e59c6 100644 --- a/server.js +++ b/server.js @@ -713,7 +713,7 @@ app.post("/getchat", jsonParser, function (request, response) { const lines = data.split('\n'); // Iterate through the array of strings and parse each line as JSON - const jsonData = lines.map(tryParse).filter(x => x); + const jsonData = lines.map((l) => { try { return JSON.parse(l); } catch (_) { }}).filter(x => x); return response.send(jsonData); } catch (error) { console.error(error);