(ip: string)
| 12 | * @returns `true` if the string is a valid IPv4 or IPv6 address, `false` otherwise |
| 13 | */ |
| 14 | export function isValidIPAddress(ip: string): boolean { |
| 15 | if (!ip || typeof ip !== 'string') return false |
| 16 | return isIP(ip) !== 0 // Returns 4 for IPv4, 6 for IPv6, 0 for invalid |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * Checks if a string is a valid IPv4 address. |
no outgoing calls
no test coverage detected