From 4e9e0a63ec2b2d851fb8d899d095fdbacfb7d5ff Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Sat, 1 May 2021 23:34:16 +0200 Subject: [PATCH] refactor: hostRules.hosts() simplification --- lib/util/host-rules.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/util/host-rules.ts b/lib/util/host-rules.ts index 69fef706e2bc39..a0df94b9025c7a 100644 --- a/lib/util/host-rules.ts +++ b/lib/util/host-rules.ts @@ -164,15 +164,7 @@ export function find(search: HostRuleSearch): HostRule { export function hosts({ hostType }: { hostType: string }): string[] { return hostRules .filter((rule) => rule.hostType === hostType) - .map((rule) => { - if (rule.hostName) { - return rule.hostName; - } - if (rule.baseUrl) { - return URL.parse(rule.baseUrl).hostname; - } - return null; - }) + .map((rule) => rule.resolvedHost) .filter(Boolean); }