Skip to content

Commit 7a09274

Browse files
author
Veetaha
committed
vscode: refactor inverted ternaries to if statements as per @matklad
1 parent 34241b9 commit 7a09274

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

editors/code/src/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ export class Config {
9797

9898
const prebuiltBinaryName = Config.prebuiltLangServerFileName(process.platform);
9999

100-
return !prebuiltBinaryName ? null : {
100+
if (!prebuiltBinaryName) return null;
101+
102+
return {
101103
type: BinarySource.Type.GithubRelease,
102104
dir: ctx.globalStoragePath,
103105
file: prebuiltBinaryName,

editors/code/src/installation/fetch_latest_artifact_metadata.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export async function fetchLatestArtifactMetadata(
2626

2727
const artifact = response.assets.find(artifact => artifact.name === artifactFileName);
2828

29-
return !artifact ? null : {
29+
if (!artifact) return null;
30+
31+
return {
3032
releaseName: response.name,
3133
downloadUrl: artifact.browser_download_url
3234
};

0 commit comments

Comments
 (0)