From 7a09274e52dc00f7d4e3a040686aa1eb1e075671 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 9 Feb 2020 13:45:06 +0200 Subject: vscode: refactor inverted ternaries to if statements as per @matklad --- editors/code/src/config.ts | 4 +++- editors/code/src/installation/fetch_latest_artifact_metadata.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'editors') diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 46394600b..d5f3da2ed 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -97,7 +97,9 @@ export class Config { const prebuiltBinaryName = Config.prebuiltLangServerFileName(process.platform); - return !prebuiltBinaryName ? null : { + if (!prebuiltBinaryName) return null; + + return { type: BinarySource.Type.GithubRelease, dir: ctx.globalStoragePath, file: prebuiltBinaryName, diff --git a/editors/code/src/installation/fetch_latest_artifact_metadata.ts b/editors/code/src/installation/fetch_latest_artifact_metadata.ts index f1019e089..9141c92ef 100644 --- a/editors/code/src/installation/fetch_latest_artifact_metadata.ts +++ b/editors/code/src/installation/fetch_latest_artifact_metadata.ts @@ -26,7 +26,9 @@ export async function fetchLatestArtifactMetadata( const artifact = response.assets.find(artifact => artifact.name === artifactFileName); - return !artifact ? null : { + if (!artifact) return null; + + return { releaseName: response.name, downloadUrl: artifact.browser_download_url }; -- cgit v1.2.3