From 686ec4924e1eb93c1b0478c4eb1ffa803613f9fc Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Mon, 26 Aug 2024 10:03:51 +0200 Subject: [PATCH] Replace ES5-style functions in code for sending data to a statistics server with ES6-style functions --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index df540b5..89398ae 100644 --- a/src/index.js +++ b/src/index.js @@ -1008,13 +1008,13 @@ function listeningMessage() { "Content-Length": Buffer.byteLength(statisticsToSend), }, }, - function (res) { + (res) => { const statusCode = res.statusCode; let data = ""; - res.on("data", function (chunk) { + res.on("data", (chunk) => { data += chunk.toString(); }); - res.on("end", function () { + res.on("end", () => { try { let parsedJson = {}; try { @@ -1036,7 +1036,7 @@ function listeningMessage() { }); }, ); - statisticsRequest.on("error", function (err) { + statisticsRequest.on("error", (err) => { serverconsole.locwarnmessage( "There was a problem, when sending data to statistics server! Reason: " + err.message,