Use JSON instead of json5
This commit is contained in:
parent
6f0f420063
commit
1d38109dcf
|
@ -713,7 +713,7 @@ app.post("/getchat", jsonParser, function (request, response) {
|
||||||
const lines = data.split('\n');
|
const lines = data.split('\n');
|
||||||
|
|
||||||
// Iterate through the array of strings and parse each line as JSON
|
// 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);
|
return response.send(jsonData);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
Loading…
Reference in New Issue