( self: IpAddress | SocketAddress, scheme: string = "http" )
| 2175 | * @since 4.0.0 |
| 2176 | */ |
| 2177 | export const formatUrl = ( |
| 2178 | self: IpAddress | SocketAddress, |
| 2179 | scheme: string = "http" |
| 2180 | ): Result.Result<string, NetAddressError> => |
| 2181 | isUnixPathAddress(self) |
| 2182 | ? Result.succeed(formatUnixPath(self)) |
| 2183 | : Result.map(toUrl(self, scheme), (url) => `${url.protocol}//${url.host}`) |
| 2184 | |
| 2185 | /** |
| 2186 | * Formats an IP or socket address as a URL display string, |
no test coverage detected