From 1f1bda2c5a1d897b39df7a936e14c31e74e1dfff Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 26 Feb 2020 14:21:23 +0100 Subject: Remove unnecessary dep --- editors/code/package-lock.json | 11 ----------- editors/code/package.json | 2 -- editors/code/src/installation/download_artifact.ts | 21 ++++++++------------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json index 0288a468e..6901363fc 100644 --- a/editors/code/package-lock.json +++ b/editors/code/package-lock.json @@ -112,12 +112,6 @@ "@types/node": "*" } }, - "@types/throttle-debounce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz", - "integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==", - "dev": true - }, "@types/vscode": { "version": "1.42.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.42.0.tgz", @@ -1517,11 +1511,6 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, - "throttle-debounce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-2.1.0.tgz", - "integrity": "sha512-AOvyNahXQuU7NN+VVvOOX+uW6FPaWdAOdRP5HfwYxAfCzXTFKRMoIMk+n+po318+ktcChx+F1Dd91G3YHeMKyg==" - }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", diff --git a/editors/code/package.json b/editors/code/package.json index dff535fcd..27e2bbfc3 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -27,7 +27,6 @@ "dependencies": { "jsonc-parser": "^2.1.0", "node-fetch": "^2.6.0", - "throttle-debounce": "^2.1.0", "vscode-languageclient": "^6.1.1" }, "devDependencies": { @@ -35,7 +34,6 @@ "@rollup/plugin-node-resolve": "^7.1.1", "@types/node": "^12.12.27", "@types/node-fetch": "^2.5.4", - "@types/throttle-debounce": "^2.1.0", "@types/vscode": "^1.42.0", "@typescript-eslint/eslint-plugin": "^2.20.0", "@typescript-eslint/parser": "^2.20.0", diff --git a/editors/code/src/installation/download_artifact.ts b/editors/code/src/installation/download_artifact.ts index 356723aba..8ed99bf0a 100644 --- a/editors/code/src/installation/download_artifact.ts +++ b/editors/code/src/installation/download_artifact.ts @@ -5,7 +5,6 @@ import { strict as assert } from "assert"; import { ArtifactReleaseInfo } from "./interfaces"; import { downloadFile } from "./download_file"; -import { throttle } from "throttle-debounce"; /** * Downloads artifact from given `downloadUrl`. @@ -38,19 +37,15 @@ export async function downloadArtifact( async (progress, _cancellationToken) => { let lastPrecentage = 0; const filePermissions = 0o755; // (rwx, r_x, r_x) - await downloadFile(downloadUrl, installationPath, filePermissions, throttle( - 200, - /* noTrailing: */ true, - (readBytes, totalBytes) => { - const newPercentage = (readBytes / totalBytes) * 100; - progress.report({ - message: newPercentage.toFixed(0) + "%", - increment: newPercentage - lastPrecentage - }); + await downloadFile(downloadUrl, installationPath, filePermissions, (readBytes, totalBytes) => { + const newPercentage = (readBytes / totalBytes) * 100; + progress.report({ + message: newPercentage.toFixed(0) + "%", + increment: newPercentage - lastPrecentage + }); - lastPrecentage = newPercentage; - }) - ); + lastPrecentage = newPercentage; + }); } ); } -- cgit v1.2.3