( networkInterface: MulticastInterface, scopeIds: ReadonlyMap<string, number>, platform?: string )
| 2090 | * @since 4.0.0 |
| 2091 | */ |
| 2092 | export const formatMulticastInterface = ( |
| 2093 | networkInterface: MulticastInterface, |
| 2094 | scopeIds: ReadonlyMap<string, number>, |
| 2095 | platform?: string |
| 2096 | ): string => { |
| 2097 | if (typeof networkInterface !== "number") return formatIp(networkInterface) |
| 2098 | if (networkInterface === 0) return "::" |
| 2099 | if (platform !== "win32") { |
| 2100 | for (const [name, scopeId] of scopeIds) { |
| 2101 | if (scopeId === networkInterface) return `::%${name}` |
| 2102 | } |
| 2103 | } |
| 2104 | return `::%${networkInterface}` |
| 2105 | } |
| 2106 | |
| 2107 | /** |
| 2108 | * Formats a resolved internet address, bracketing IPv6 around its port. |
nothing calls this directly
no test coverage detected