Skip to content

Commit

Permalink
refactor: hostRules.hosts() simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed May 1, 2021
1 parent 49272cc commit 4e9e0a6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/util/host-rules.ts
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4e9e0a6

Please sign in to comment.