(input: string)
| 1071 | * @since 4.0.0 |
| 1072 | */ |
| 1073 | export const ipFromString = (input: string): Result.Result<IpAddress, NetAddressError> => { |
| 1074 | const result: Result.Result<IpAddress, NetAddressError> = input.includes(":") |
| 1075 | ? ipv6FromString(input) |
| 1076 | : ipv4FromString(input) |
| 1077 | return result |
| 1078 | } |
| 1079 | |
| 1080 | /** |
| 1081 | * Parses a trusted bare numeric IPv4 or IPv6 address, throwing on failure. |
no test coverage detected