Remove unnecessary dep

This commit is contained in:
Aleksey Kladov 2020-02-26 14:21:23 +01:00
parent 80f8e474a0
commit 1f1bda2c5a
3 changed files with 8 additions and 26 deletions

View file

@ -112,12 +112,6 @@
"@types/node": "*" "@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": { "@types/vscode": {
"version": "1.42.0", "version": "1.42.0",
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.42.0.tgz", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.42.0.tgz",
@ -1517,11 +1511,6 @@
"integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
"dev": true "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": { "through": {
"version": "2.3.8", "version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",

View file

@ -27,7 +27,6 @@
"dependencies": { "dependencies": {
"jsonc-parser": "^2.1.0", "jsonc-parser": "^2.1.0",
"node-fetch": "^2.6.0", "node-fetch": "^2.6.0",
"throttle-debounce": "^2.1.0",
"vscode-languageclient": "^6.1.1" "vscode-languageclient": "^6.1.1"
}, },
"devDependencies": { "devDependencies": {
@ -35,7 +34,6 @@
"@rollup/plugin-node-resolve": "^7.1.1", "@rollup/plugin-node-resolve": "^7.1.1",
"@types/node": "^12.12.27", "@types/node": "^12.12.27",
"@types/node-fetch": "^2.5.4", "@types/node-fetch": "^2.5.4",
"@types/throttle-debounce": "^2.1.0",
"@types/vscode": "^1.42.0", "@types/vscode": "^1.42.0",
"@typescript-eslint/eslint-plugin": "^2.20.0", "@typescript-eslint/eslint-plugin": "^2.20.0",
"@typescript-eslint/parser": "^2.20.0", "@typescript-eslint/parser": "^2.20.0",

View file

@ -5,7 +5,6 @@ import { strict as assert } from "assert";
import { ArtifactReleaseInfo } from "./interfaces"; import { ArtifactReleaseInfo } from "./interfaces";
import { downloadFile } from "./download_file"; import { downloadFile } from "./download_file";
import { throttle } from "throttle-debounce";
/** /**
* Downloads artifact from given `downloadUrl`. * Downloads artifact from given `downloadUrl`.
@ -38,19 +37,15 @@ export async function downloadArtifact(
async (progress, _cancellationToken) => { async (progress, _cancellationToken) => {
let lastPrecentage = 0; let lastPrecentage = 0;
const filePermissions = 0o755; // (rwx, r_x, r_x) const filePermissions = 0o755; // (rwx, r_x, r_x)
await downloadFile(downloadUrl, installationPath, filePermissions, throttle( await downloadFile(downloadUrl, installationPath, filePermissions, (readBytes, totalBytes) => {
200, const newPercentage = (readBytes / totalBytes) * 100;
/* noTrailing: */ true, progress.report({
(readBytes, totalBytes) => { message: newPercentage.toFixed(0) + "%",
const newPercentage = (readBytes / totalBytes) * 100; increment: newPercentage - lastPrecentage
progress.report({ });
message: newPercentage.toFixed(0) + "%",
increment: newPercentage - lastPrecentage
});
lastPrecentage = newPercentage; lastPrecentage = newPercentage;
}) });
);
} }
); );
} }