Conditions used in annotations.
A condition is a function that takes a value and an optional context map as parameters
and returns a result map. The context map contains extra data that is passed as input. The
result map will be empty if the conditiong is satisfied (indicating success). Otherwise, it will
have at least one of the keys :warnings
and :errors
. These keys will map to a sequence
of warning and error message strings respectively.
Conditions used in annotations. A condition is a function that takes a value and an optional context map as parameters and returns a result map. The context map contains extra data that is passed as input. The result map will be empty if the conditiong is satisfied (indicating success). Otherwise, it will have at least one of the keys `:warnings` and `:errors`. These keys will map to a sequence of warning and error message strings respectively.
(and cnd & cnds)
Forms a compound condition that evaluates the given conditions one at a time, from left
to right. If a condition returns an error or warning result, and
returns that value
and doesn't evaluate any of the other conditions, otherwise it returns the result of the
last condition.
Forms a compound condition that evaluates the given conditions one at a time, from left to right. If a condition returns an error or warning result, `and` returns that value and doesn't evaluate any of the other conditions, otherwise it returns the result of the last condition.
(coll-length opts)
(coll-length opts)
returns a condition to check if length of a collection matches
certain criteria. opts
is a map specifying the match criteria and can have the
following keys:
:lt - collection length must be less than the value of this key :le - collection length must be less than or equal to the value of this key :gt - collection length must be greater than the value of this key :ge - collection length must be greater than or equal to the value of this key :eq - collection length must be equal to the value of this key :ne - collection length must not be equal to the value of this key
`(coll-length opts)` returns a condition to check if length of a collection matches certain criteria. `opts` is a map specifying the match criteria and can have the following keys: :lt - collection length must be less than the value of this key :le - collection length must be less than or equal to the value of this key :gt - collection length must be greater than the value of this key :ge - collection length must be greater than or equal to the value of this key :eq - collection length must be equal to the value of this key :ne - collection length must not be equal to the value of this key
(or cnd & cnds)
Forms a compound condition that evaluates conditions one at a time, from left to
right. If a condition returns a success value, or
returns that value and doesn't
evaluate any of the other conditions, otherwise it returns the value of the last
condition
Forms a compound condition that evaluates conditions one at a time, from left to right. If a condition returns a success value, `or` returns that value and doesn't evaluate any of the other conditions, otherwise it returns the value of the last condition
(regex-match? re)
(regex-match re)
returns a condition that takes a string s
as input and checks if
it matches the regular expression re
`(regex-match re)` returns a condition that takes a string `s` as input and checks if it matches the regular expression `re`
(string-length opts)
(string-length opts)
returns a condition to check if length of a string matches certain
criteria. opts
is a map specifying the match criteria and can have the following keys:
:lt - string length must be less than the value of this key :le - string length must be less than or equal to the value of this key :gt - string length must be greater than the value of this key :ge - string length must be greater than or equal to the value of this key :eq - string length must be equal to the value of this key :ne - string length must not be equal to the value of this key
`(string-length opts)` returns a condition to check if length of a string matches certain criteria. `opts` is a map specifying the match criteria and can have the following keys: :lt - string length must be less than the value of this key :le - string length must be less than or equal to the value of this key :gt - string length must be greater than the value of this key :ge - string length must be greater than or equal to the value of this key :eq - string length must be equal to the value of this key :ne - string length must not be equal to the value of this key
(unique-attribute? k)
(unique-attribute k)
returns a condition that takes a sequence of maps ms
and ensure
that the value of attribute k
is unique across all the maps.
`(unique-attribute k)` returns a condition that takes a sequence of maps `ms` and ensure that the value of attribute `k` is unique across all the maps.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close