Function isIpAddress

  • 检查是否为 ip string

    Parameters

    • value: string

      字符串值

    Returns boolean

    isIpAddress('::1'); /// true
    isIpAddress('127.0.0.1'); /// true
    isIpAddress('2001:DB8:0:0:8:800:200C:417A'); /// true
    isIpAddress('255.255.255.123.123'); /// false