checks.checkers
The checkers global table provides access to checkers for different types. It can be extended with custom checkers that perform arbitrary validations.
Methods14
function checkers.datetime(arg: any) -> boolean
Check that the value is a datetime object.
function checkers.decimal(arg: any) -> boolean
Check that the value has the decimal type.
function checkers.error(arg: any) -> boolean
Check that the value is an error object.
function checkers.int64(arg: any) -> boolean
Check that the value is an int64 value.
function checkers.interval(arg: any) -> boolean
Check that the value is an interval object.
function checkers.tuple(arg: any) -> boolean
Check that the value is a tuple.
function checkers.uint64(arg: any) -> boolean
Check that the value is a uint64 value.
function checkers.uuid(arg: any) -> boolean
Check that the value is a uuid object.
function checkers.uuid_bin(arg: any) -> boolean
Check that the value is a uuid as a 16-byte binary string.
function checkers.uuid_str(arg: any) -> boolean
Check that the value is a uuid as a 36-byte hexadecimal string.
function checkers.uint64(arg: any) -> boolean
Check whether the specified value is a uint64 value: an integer Lua number in the range from 0 to 2^53-1 (inclusive), a cdata ctype<uint64_t>, or a cdata ctype<int64_t> in the range from 0 to LLONG_MAX.
arganyThe value to check.
- boolean
trueif the value is auint64value,falseotherwise.
function checkers.int64(arg: any) -> boolean
Check whether the specified value is an int64 value: an integer Lua number in the range from -2^53+1 to 2^53-1 (inclusive), a cdata ctype<int64_t>, or a cdata ctype<uint64_t> in the range from 0 to LLONG_MAX.
arganyThe value to check.
- boolean
trueif the value is anint64value,falseotherwise.
function checkers.uuid_str(arg: any) -> boolean
Check whether the specified value is a uuid represented by a 36-byte hexadecimal string.
arganyThe value to check.
- boolean
trueif the value is a uuid string,falseotherwise.
function checkers.uuid_bin(arg: any) -> boolean
Check whether the specified value is a uuid represented by a 16-byte binary string.
arganyThe value to check.
- boolean
trueif the value is a uuid binary string,falseotherwise.