MCPcopy Create free account
hub / github.com/Effect-TS/effect / formatInet

Function formatInet

packages/effect/src/net/NetAddress.ts:2114–2117  ·  view source on GitHub ↗
(self: InetAddress)

Source from the content-addressed store, hash-verified

2112 * @since 4.0.0
2113 */
2114export const formatInet = (self: InetAddress): string => {
2115 const host = formatHost(self)
2116 return isInetAddressV4(self) ? `${host}:${self.port}` : `[${host}]:${self.port}`
2117}
2118
2119/**
2120 * Formats an IP address for use as a URL authority host.

Callers 3

toStringFunction · 0.85
toUrlFunction · 0.85
formatSocketAddressFunction · 0.85

Calls 2

isInetAddressV4Function · 0.85
formatHostFunction · 0.70

Tested by

no test coverage detected