CrossClj

0.1.8 docs

SourceDocs


project

docs index

NAMESPACES
validata

RECENT
    VARS
    boolean
    boolean?
    double
    double?
    errors
    errors-for-expected-keys
    errors-for-unexpected-keys
    extra-keys
    extra-keys?
    float
    float?
    if-valid
    integer
    integer?
    key-keyword
    key-keyword?
    key-present?
    key-string
    key-string?
    keyword
    keyword?
    map
    map?
    not-nil
    not-nil?
    number
    number?
    positive
    positive?
    property-error
    property-errors
    required
    seq
    seq?
    set
    set?
    string
    string?
    timestamp
    timestamp-string
    timestamp-string?
    timestamp?
    uuid
    uuid-re
    uuid-string
    uuid-string?
    uuid?
    valid?
    vector
    vector?

    « Index of all namespaces of this project

    Validation functions.
    
    All validation functions must accept these three arguments --
    key, value, properties -- even if the function does not use some
    of the arguments. This convention allows for function composition.
    
    There are two kinds of validation functions:
    
      A. Key Validation Functions
    
         These are functions that test the key, not the value. By
         convention, there names must begin with 'key-'.
    
      B. Value Validation Functions
    
         These are functions that test the value. All must:
    
         1. Return true when a key is nil. This is by design; use
           key-required if a key is required.
         2. Return false if a key is present but the value is nil. To
            signify a missing value, do not pass the key.
    (boolean? k v props)
    If key not nil, is value a boolean?
    
    (double? k v props)
    If key not nil, is value a double?
    
    (errors m validation-map)(errors m validation-map allow-extra-keys?)
    Validate the map using validations. Returns a map of failures, if any.
    Set allow-extra-keys?, an optional third parameter, to false to cause a
    failure if unspecified keys are given.
    (errors-for-expected-keys m validation-map)
    Validate the map using validations. Returns a map of failures, if any.
    
    (errors-for-unexpected-keys m validation-map)
    Validate the map using validations. Returns a map of failures, if any.
    
    (extra-keys m v-map)
    Returns the set of extra keys in map m that are not present in
    validation map v-map.
    (extra-keys? m v-map)
    Does map m include keys that are not listed in validation-map?
    
    (float? k v props)
    If key not nil, is value a java.lang.Float?
    
    Note: this is different from clojure.core/float?
    (if-valid m validations f)(if-valid m validations allow-extra-keys? f)
    If valid, call function with map; otherwise, throw exception.
    
    (integer? k v props)
    If key not nil, is value an integer?
    
    (key-keyword? k v props)
    If key not nil, is the key a keyword?
    
    (key-present? k v props)
    Is the key present?
    
    (key-string? k v props)
    If key not nil, is the key a string?
    
    (keyword? k v props)
    If key not nil, is value a keyword?
    
    (map? k v props)
    If key not nil, is value a map?
    
    (not-nil? k v props)
    If key not nil, is value not nil?
    
    (number? k v props)
    If key not nil, is value a number?
    
    (positive? k v props)
    If key not nil, is value positive?
    
    (property-error k v validation props)
    Validate a property (a key and value) against a validation. Returns error
    or nil.
    (property-errors k v validations props)
    Validate a property (a key and value) against validations. Returns a vector
    of errors or [].
    (seq? k v props)
    If key not nil, is value a seq?
    
    (set? k v props)
    If key not nil, is value a set?
    
    (string? k v props)
    If key not nil, is value a string?
    
    (timestamp-string? k v props)
    If key not nil, is value a timestamp string?
    
    (timestamp? k v props)
    If key not nil, is value a timestamp?
    
    (uuid-string? k v props)
    If key not nil, is value a uuid string?
    
    (uuid? k v props)
    If key not nil, is value a uuid?
    
    (valid? m validation-map)(valid? m validation-map allow-extra-keys?)
    Is the map valid for the given validations?
    
    (vector? k v props)
    If key not nil, is value a vector?