vscode: replaced unwrapNotNil() with ! as per @matklad

This commit is contained in:
Veetaha 2020-02-09 13:59:27 +02:00
parent 7a09274e52
commit a63659badb
3 changed files with 3 additions and 21 deletions

View file

@ -753,19 +753,6 @@
"os-tmpdir": "~1.0.1"
}
},
"ts-not-nil": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/ts-not-nil/-/ts-not-nil-1.0.1.tgz",
"integrity": "sha512-19+u+3okJddVZlrIdTOdFBaMsHYDInIGDPiujxfRa0RS2Ch5055zVG4GAqa+CZ/Rd1a+7ORSm8O4+2kesPymtw==",
"requires": {
"ts-typedefs": ">=3.2.0"
}
},
"ts-typedefs": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ts-typedefs/-/ts-typedefs-3.2.0.tgz",
"integrity": "sha512-NglEH2YiY40YxNAvwBISqqXRTKlQq6x+qoCF+tkjPxwrPbrkmq7V3LXavmxrD63fENtMhFkcqgMJtOirtow9iA=="
},
"tslib": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",

View file

@ -27,7 +27,6 @@
"jsonc-parser": "^2.1.0",
"node-fetch": "^2.6.0",
"throttle-debounce": "^2.1.0",
"ts-not-nil": "^1.0.1",
"vscode-languageclient": "^6.1.0"
},
"devDependencies": {

View file

@ -1,4 +1,3 @@
import { unwrapNotNil } from "ts-not-nil";
import { spawnSync } from "child_process";
import * as vscode from "vscode";
import * as path from "path";
@ -12,12 +11,9 @@ import { downloadFile } from "./download_file";
export async function downloadLatestLanguageServer(
{file: artifactFileName, dir: installationDir, repo}: BinarySource.GithubRelease
) {
const binaryMetadata = await fetchLatestArtifactMetadata(repo, artifactFileName);
const {
releaseName,
downloadUrl
} = unwrapNotNil(binaryMetadata, `Latest GitHub release lacks "${artifactFileName}" file`);
const { releaseName, downloadUrl } = (await fetchLatestArtifactMetadata(
repo, artifactFileName
))!;
await fs.mkdir(installationDir).catch(err => assert.strictEqual(
err?.code,