Function isIp

  • Returns a boolean value denoting whether the input string is a valid IP address

    Example

    Returns true for a valid IPv4

    isIp("245.108.222.0");
    

    Example

    Returns true for a valid IPv6

    isIp("269f:1230:73e3:318d:842b:daab:326d:897b");
    

    Example

    Returns false

    isIp("foo123");
    

    Parameters

    • str: string

    Returns boolean

Generated using TypeDoc