MCPcopy
hub / github.com/FlowiseAI/Flowise / isValidIPAddress

Function isValidIPAddress

packages/server/src/utils/ipValidation.ts:14–17  ·  view source on GitHub ↗
(ip: string)

Source from the content-addressed store, hash-verified

12 * @returns `true` if the string is a valid IPv4 or IPv6 address, `false` otherwise
13 */
14export 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.

Callers 3

sanitizeIPAddressFunction · 0.90
getGeolocationFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected