From 9fb131e5feae4a9cd27f22cc6a62ecfa574a8f48 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 10 Apr 2026 22:35:59 +0100 Subject: [PATCH] refactor: remove redundant gateway configure conversions --- src/commands/configure.gateway.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/commands/configure.gateway.ts b/src/commands/configure.gateway.ts index 7142b2e202c..a4ef818e299 100644 --- a/src/commands/configure.gateway.ts +++ b/src/commands/configure.gateway.ts @@ -42,7 +42,7 @@ export async function promptGatewayConfig( }), runtime, ); - const port = Number.parseInt(String(portRaw), 10); + const port = Number.parseInt(portRaw, 10); let bind = guardCancel( await select({ @@ -129,14 +129,12 @@ export async function promptGatewayConfig( let tailscaleResetOnExit = false; if (tailscaleMode !== "off") { note(TAILSCALE_DOCS_LINES.join("\n"), "Tailscale"); - tailscaleResetOnExit = Boolean( - guardCancel( - await confirm({ - message: "Reset Tailscale serve/funnel on exit?", - initialValue: false, - }), - runtime, - ), + tailscaleResetOnExit = guardCancel( + await confirm({ + message: "Reset Tailscale serve/funnel on exit?", + initialValue: false, + }), + runtime, ); } @@ -274,7 +272,7 @@ export async function promptGatewayConfig( runtime, ); const requiredHeaders = requiredHeadersRaw - ? normalizeStringEntries(String(requiredHeadersRaw).split(",")) + ? normalizeStringEntries(requiredHeadersRaw.split(",")) : []; const allowUsersRaw = guardCancel( @@ -284,9 +282,7 @@ export async function promptGatewayConfig( }), runtime, ); - const allowUsers = allowUsersRaw - ? normalizeStringEntries(String(allowUsersRaw).split(",")) - : []; + const allowUsers = allowUsersRaw ? normalizeStringEntries(allowUsersRaw.split(",")) : []; const trustedProxiesRaw = guardCancel( await text({ @@ -301,7 +297,7 @@ export async function promptGatewayConfig( }), runtime, ); - trustedProxies = normalizeStringEntries(String(trustedProxiesRaw).split(",")); + trustedProxies = normalizeStringEntries(trustedProxiesRaw.split(",")); trustedProxyConfig = { userHeader: normalizeOptionalString(userHeader) ?? "",