diff --git a/src/util.ts b/src/util.ts index 9e823c786486d235b61935d072dbe25eb3017b0b..142f6d372cb2b3a022a9d8a8568e701918228a37 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,11 +1,12 @@ import * as vscode from "vscode"; -export function toSortedKeys(map: Map): string[] { - // Todo can I ignore the map value type in a better way +type platform = "darwin-amd64" | "windows-amd64" | "linux-amd64"; + +export function toSortedKeys(map: Map): string[] { return Array.from(map.keys()).sort(); } -export function executableFileEnding() { +export function executableFileEnding(): "" | ".exe" | never { if (determinePlatform() === "windows-amd64") { return ".exe"; } else { @@ -13,7 +14,7 @@ export function executableFileEnding() { } } -export function determinePlatform() { +export function determinePlatform(): platform { // also look at process.arch switch (process.platform) { case "darwin":