From ff4f92709b49c9024f8eeff810bde54722a9e854 Mon Sep 17 00:00:00 2001 From: Dmitry Kisler Date: Thu, 12 Oct 2023 17:39:39 +0200 Subject: [PATCH] chore: refactors mapOS func. Signed-off-by: Dmitry Kisler --- dist/index.js | 8 ++++---- lib/setup-tofu.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8a47772..807054b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -139,10 +139,10 @@ function mapArch (arch) { // os in [darwin, linux, win32...] (https://nodejs.org/api/os.html#os_os_platform) // return value in [darwin, linux, windows] function mapOS (os) { - const mappings = { - win32: 'windows' - }; - return mappings[os] || os; + if (os === 'win32') { + return 'windows'; + } + return os; } async function downloadCLI (url) { diff --git a/lib/setup-tofu.js b/lib/setup-tofu.js index 24e12a1..0b1d4c8 100644 --- a/lib/setup-tofu.js +++ b/lib/setup-tofu.js @@ -28,10 +28,10 @@ function mapArch (arch) { // os in [darwin, linux, win32...] (https://nodejs.org/api/os.html#os_os_platform) // return value in [darwin, linux, windows] function mapOS (os) { - const mappings = { - win32: 'windows' - }; - return mappings[os] || os; + if (os === 'win32') { + return 'windows'; + } + return os; } async function downloadCLI (url) {