CrossClj

0.10.1 docs

SourceDocs



RECENT
    VARS
    any-keys
    any-keyword-keys
    AnyKeys
    AnyKeywordKeys
    assoc
    assoc-in
    default
    dissoc
    dissoc-in
    explicit-key
    explicit-key-set
    get-in
    get-in-schema
    index-in-schema
    key-in-schema
    maybe-anonymous
    merge
    open-schema
    optional-keys
    required-keys
    resolve-schema
    resolve-schema-description
    schema-description
    schema-value
    schema-with-description
    select-keys
    select-schema
    single-sequence-element?
    transform-keys
    unwrap-sequence-schemas
    update
    update-in

    « Index of all namespaces of this project

    (any-keyword-keys & schemas)
    (assoc schema & kvs)
    Assoc[iate]s key & vals into Schema.
    
    (assoc-in schema [k & ks] v)
    Associates a value in a nested associative Schema, where ks is a
    sequence of keys and v is the new value and returns a new nested Schema.
    If any levels do not exist, hash-maps will be created.
    (default schema default)
    (dissoc schema & ks)
    Dissoc[iate]s keys from Schema.
    
    (dissoc-in schema [k & ks])
    Dissociates an entry from a nested associative Schema returning a new
    nested structure. keys is a sequence of keys. Any empty maps that result
    will not be present in the new Schema.
    Private
    (explicit-key k)
    Private
    (explicit-key-set ks)
    (get-in m ks)(get-in m ks not-found)
    Returns the value in a nested associative Schema,
    where ks is a sequence of keys. Returns nil if the key
    is not present, or the not-found value if supplied.
    Private
    (get-in-schema m k & [default])
    Private
    (index-in-schema m k)
    Private
    (key-in-schema m k)
    Private
    (maybe-anonymous original current)
    (merge & schemas)
    Returns a Schema that consists of the rest of the Schemas conj-ed onto
    the first. If a schema key occurs in more than one map, the mapping from
    the latter (left-to-right) will be the mapping in the result. Works only
    with Map schemas.
    (open-schema schema)
    Walks a schema adding [s/Any s/Any] entry to all Map Schemas, removing any
    existing extra keys if defined.
    (optional-keys m)(optional-keys m ks)
    Makes given map keys optional. Defaults to all keys.
    
    (required-keys m)(required-keys m ks)
    Makes given map keys required. Defaults to all keys.
    
    (resolve-schema schema)
    Returns the schema var if the schema contains the :name and :ns
    definitions (set by schema.core/defschema).
    (resolve-schema-description schema)
    Returns the schema description, in this lookup order:
    a) schema meta :description
    b) schema var meta :doc if not ""
    c) nil
    (schema-description schema)
    Returns the description of a schema attached via schema-with-description.
    
    (schema-value s)
    Returns the sub-schema or sub-schemas of given schema.
    
    (schema-with-description schema description)
    Records description in schema's metadata.
    
    (select-keys schema ks)
    Like clojure.core/select-keys but handles boths optional-keys and required-keys.
    
    (select-schema value schema)(select-schema value schema matcher)
    Strips all disallowed keys from nested Map schemas via coercion. Takes an optional
    coercion matcher for extra coercing the selected value(s) on a single sweep. If a value
    can't be coerced to match the schema ExceptionInfo is thrown (like schema.core/validate).
    Private
    (single-sequence-element? x)
    Private
    (transform-keys schema f ks)
    Private
    (unwrap-sequence-schemas m)
    (update schema k f & args)
    Updates a value in a map with a function.
    
    (update-in schema [k & ks] f & args)
    'Updates' a value in a nested associative Schema, where ks is a
    sequence of keys and f is a function that will take the old value
    and any supplied args and return the new value, and returns a new
    nested Schema. If any levels do not exist, hash-maps will be
    created.