(address: Ipv4Address, port: number)
| 1625 | * @since 4.0.0 |
| 1626 | */ |
| 1627 | export const inetAddressV4 = (address: Ipv4Address, port: number): Result.Result<InetAddressV4, NetAddressError> => { |
| 1628 | if (!checkPort(port)) { |
| 1629 | return addressError(address, "port must be an integer from 0 through 65535") |
| 1630 | } |
| 1631 | const self = Object.create(InetV4Proto) |
| 1632 | self.address = address |
| 1633 | self.port = port |
| 1634 | return Result.succeed(Object.freeze(self)) |
| 1635 | } |
| 1636 | |
| 1637 | /** |
| 1638 | * Creates a checked IPv6 internet address with an optional scope identifier. |
no test coverage detected