Skip to main content

Conditions

Conditions are built-in tests that return a boolean value. The IP conditions check the format of a string; the global conditions check the type of any value.

isValidIP(s)

return true if the input string is a valid ip address

isIPv4(s)

return true if the input string is a valid IPv4 address

isIPv6(s)

return true if the input string is a valid IPv6 address

isNull(var)

return true if var is a null type, false otherwise

isNull("Hello") // return false
isNull(null) // return true

isUndef(var)

return true if var is undefined type, false otherwise

isUndef(null) // return false

let s = coalesce("", "", "") // return undefined
isUndef(s) // return true

isString(var)

return true if var is of string type, false otherwise

isString("abc") // return true
isString(64) // return false

isBlob(var)

return true if var is of blob type, false otherwise

isNumber(var)

return true if var is of int64 or float64 type, false otherwise

isNumber("abc") // return false
isNumber(64) // return true

ipNormalize(s)

ipNormalize is a function rather than a condition: it returns an address, not a boolean.

return normalized IP address.