From 5a5eaef3753bf20310e14145cfa7012115f1b9a1 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 21 Jul 2023 11:04:32 +0300 Subject: [PATCH] Refactor escape-host.js --- lib/escape-host.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/escape-host.js b/lib/escape-host.js index 9f610675d9..30ef97f9b0 100644 --- a/lib/escape-host.js +++ b/lib/escape-host.js @@ -1,8 +1 @@ -module.exports = host => { - if (host.includes(':')) { - // ipv6 - return `[${host}]`; - } else { - return host; - } -}; +module.exports = host => host.includes(':') ? `[${host}]` : host \ No newline at end of file