From 114f561f049329c7362dfb07e37ff5541bb903d2 Mon Sep 17 00:00:00 2001 From: 9KwHCUDP <54501060+9KwHCUDP@users.noreply.github.com> Date: Thu, 29 Aug 2019 01:08:36 +0300 Subject: [PATCH] Cleaner code --- index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 86c7111..12b858c 100644 --- a/index.js +++ b/index.js @@ -365,10 +365,8 @@ class CSGOCdn extends EventEmitter { this.log.info(`${status} Downloading ${fileName} - ${bytesToMB(file.size)} MB`); - await this.user.downloadFile(730, 731, file, filePath, (none, data) => { - const { type, bytesDownloaded, totalSizeBytes } = data; - - if (type == 'progress') { + await this.user.downloadFile(730, 731, file, filePath, (none, { type, bytesDownloaded, totalSizeBytes }) => { + if (type === 'progress') { this.log.info(`${status} ${(bytesDownloaded*100/totalSizeBytes).toFixed(2)}% - ${bytesToMB(bytesDownloaded)}/${bytesToMB(totalSizeBytes)} MB`); } });