Valpa.Predicate.Validator (Valpa v0.1.1)

View Source

Built-in predicate functions for Valpa validators.

All predicates return true or false, making them useful on their own when full validation pipelines are unnecessary.

Examples

Valpa.Predicate.Validator.integer(5)
# => true

Valpa.Predicate.Validator.integer("not a number")
# => false

Summary

Functions

boolean(va)

decimal(va)

float(va)

integer(va)

integer_in_range(va, map)

list(va)

list_of_length(va, map)

list_of_type(va, type)

list_of_values(va, values)

map(va)

map_compare_decimal_keys(map, arg)

map_compare_float_keys(map, arg)

map_compare_int_keys(map, arg)

map_exclusive_keys(va, keys)

map_exclusive_optional_keys(va, keys)

map_inclusive_keys(va, keys)

maybe_boolean(arg1)

maybe_decimal(arg1)

maybe_float(arg1)

maybe_integer(arg1)

maybe_integer_in_range(arg1, arg2)

maybe_list(arg1)

maybe_list_of_length(arg1, arg2)

maybe_list_of_type(arg1, arg2)

maybe_list_of_values(arg1, arg2)

maybe_map(arg1)

maybe_map_compare_decimal_keys(arg1, arg2)

maybe_map_compare_float_keys(arg1, arg2)

maybe_map_compare_int_keys(arg1, arg2)

maybe_map_exclusive_keys(arg1, arg2)

maybe_map_exclusive_optional_keys(arg1, arg2)

maybe_map_inclusive_keys(arg1, arg2)

maybe_nonempty_map(arg1)

maybe_string(arg1)

maybe_uniq_list(arg1)

maybe_uniq_list_of_length(arg1, arg2)

maybe_uniq_list_of_type(arg1, arg2)

maybe_uniq_list_of_values(arg1, arg2)

maybe_value_of_values(arg1, arg2)

maybe_value_or_list_of_values(arg1, arg2)

maybe_value_or_uniq_list_of_values(arg1, arg2)

nonempty_map(va)

string(va)

uniq_list(va)

uniq_list_of_length(va, map)

uniq_list_of_type(va, type)

uniq_list_of_values(va, values)

value_of_values(va, values)

value_or_list_of_values(va, values)

value_or_uniq_list_of_values(va, values)