From b7ee97c15b5c634db6d1aa05f8c52dc2e25715fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 20 Nov 2023 11:41:40 +0100 Subject: [PATCH] refactor: remove unneeded encapsulation in arrow function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/Bootstrap.ts | 4 +--- src/charging-station/ocpp/OCPPRequestService.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 05bd7053..003b093a 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -228,9 +228,7 @@ export class Bootstrap extends EventEmitter { .then(() => { resolve('Charging stations stopped'); }) - .catch((error) => { - reject(error); - }) + .catch(reject) .finally(() => { clearTimeout(waitTimeout); }); diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 25305ca1..c24742d7 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -344,9 +344,7 @@ export abstract class OCPPRequestService { .then(() => { resolve(payload); }) - .catch((error) => { - reject(error); - }) + .catch(reject) .finally(() => { chargingStation.requests.delete(messageId); }); -- 2.34.1