From 348669e5c35e2ea46a927ba5f4f7564fd1d31b8d Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 22 May 2023 12:00:55 -0600 Subject: [PATCH] get primary hostanems too --- lib/util/getNetworkInterface.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/util/getNetworkInterface.ts b/lib/util/getNetworkInterface.ts index 456bc67..a2f3ce1 100644 --- a/lib/util/getNetworkInterface.ts +++ b/lib/util/getNetworkInterface.ts @@ -13,6 +13,7 @@ export type Filled = { ipv6Hostnames: HostName[] nonIpHostnames: HostName[] allHostnames: HostName[] + primaryHostname: HostName urls: UrlString[] onionUrls: UrlString[] @@ -90,6 +91,9 @@ export const filledAddress = ( ) }, allHostnames: hostnames, + get primaryHostname() { + return this.allHostnames[0] // @TODO this is a placeholder + }, get urls() { return hostnames.map(toUrl) }, @@ -155,6 +159,9 @@ export const networkInterfaceFilled = ( get allHostnames() { return unique(addresses.flatMap((x) => x.allHostnames)) }, + get primaryHostname() { + return this.allHostnames[0] // @TODO this is a placeholder + }, get urls() { return unique(addresses.flatMap((x) => x.urls)) },