( self: InetAddress, scopeIds: ReadonlyMap<string, number>, platform?: string )
| 2059 | * @since 4.0.0 |
| 2060 | */ |
| 2061 | export const formatNativeHost = ( |
| 2062 | self: InetAddress, |
| 2063 | scopeIds: ReadonlyMap<string, number>, |
| 2064 | platform?: string |
| 2065 | ): string => { |
| 2066 | if (platform !== "win32" && isInetAddressV6(self) && self.scopeId !== 0) { |
| 2067 | for (const [name, scopeId] of scopeIds) { |
| 2068 | if (scopeId === self.scopeId) return `${formatIp(self.address)}%${name}` |
| 2069 | } |
| 2070 | } |
| 2071 | return formatHost(self) |
| 2072 | } |
| 2073 | |
| 2074 | /** |
| 2075 | * Formats an IPv4 address or IPv6 interface index for a native multicast API. |
nothing calls this directly
no test coverage detected