toInetAddress
toInetAddress(
family,address):InetAddress
Defined in: packages/node/src/net/inet-address.ts:22
Normalizes a family and address into an InetAddress. Validates and converts the family to ensure it is 4, 6, or null.
Parameters
Section titled “Parameters”family
Section titled “family”string | number | null
The IP family, either as a string (‘IPv4’, ‘IPv6’), number (4, 6), or null for unknown.
address
Section titled “address”string
The IP address string.
Returns
Section titled “Returns”An InetAddress object.
Throws
Section titled “Throws”If the family is not valid (not ‘IPv4’/‘IPv6’ or 4/6 or null).