From bb2e510ff72de9c9695353c0f317495351b3e29a Mon Sep 17 00:00:00 2001 From: Manish Kumar Date: Fri, 13 Dec 2024 11:16:54 +0530 Subject: [PATCH] fix: sonarcloud code analysis --- src/v1/destinations/reddit/networkHandler.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/v1/destinations/reddit/networkHandler.js b/src/v1/destinations/reddit/networkHandler.js index 73d9e12082..608408a7fb 100644 --- a/src/v1/destinations/reddit/networkHandler.js +++ b/src/v1/destinations/reddit/networkHandler.js @@ -12,7 +12,7 @@ const { TransformerProxyError } = require('../../../v0/util/errorTypes'); const populateResponseWithDontBatch = (rudderJobMetadata, response) => { const errorMessage = JSON.stringify(response); - return rudderJobMetadata.map(metadata => { + return rudderJobMetadata.map((metadata) => { // eslint-disable-next-line no-param-reassign metadata.dontBatch = true; return { @@ -98,13 +98,10 @@ const responseHandler = (responseParams) => { response: responseWithIndividualEvents, }; }; -// eslint-disable-next-line @typescript-eslint/naming-convention -class networkHandler { - constructor() { - this.responseHandler = responseHandler; - this.proxy = proxyRequest; - this.prepareProxy = prepareProxyRequest; - this.processAxiosResponse = processAxiosResponse; - } +function networkHandler() { + this.proxy = proxyRequest; + this.processAxiosResponse = processAxiosResponse; + this.prepareProxy = prepareProxyRequest; + this.responseHandler = responseHandler; } module.exports = { networkHandler };