Liking cljdoc? Tell your friends :D

malli.util


-applyingclj/s

(-applying f)
source

-map-syntax-walkerclj/s

(-map-syntax-walker schema _ children _)
source

-mergeclj/s

(-merge)
source

-reducingclj/s

(-reducing f)
source

-required-map-entry?clj/s

(-required-map-entry? [_ ?p])
source

-select-keysclj/s

(-select-keys)
source

-simplify-map-entryclj/s

(-simplify-map-entry [k ?p s])
source

-unionclj/s

(-union)
source

-util-schemaclj/s

(-util-schema {:keys [type min max childs type-properties fn]})
source

assocclj/s

(assoc ?schema key value)
(assoc ?schema key value options)

Like [[clojure.core/assoc]], but for LensSchemas.

Like [[clojure.core/assoc]], but for LensSchemas.
sourceraw docstring

assoc-inclj/s

(assoc-in ?schema ks value)
(assoc-in ?schema [k & ks] value options)

Like [[clojure.core/assoc-in]], but for LensSchemas.

Like [[clojure.core/assoc-in]], but for LensSchemas.
sourceraw docstring

closed-schemaclj/s

(closed-schema ?schema)
(closed-schema ?schema options)

Maps are implicitly open by default. They can be explicitly closed or open by specifying the {:closed (true|false)} property.

This function converts implicitly open maps to explicitly closed maps, recursively. Explicitly open maps are left untouched.

See open-schema

Maps are implicitly open by default. They can be explicitly closed or
open by specifying the `{:closed (true|false)}` property.

This function converts implicitly open maps to explicitly closed
maps, recursively. Explicitly open maps are left untouched.

See [[open-schema]]
sourceraw docstring

data-explainerclj/s

(data-explainer ?schema)
(data-explainer ?schema options)

Like m/explainer but output is pure clojure data. Schema objects have been replaced with their m/form. Useful when you need to serialise errrors.

Like `m/explainer` but output is pure clojure data. Schema objects have been replaced with their m/form.
Useful when you need to serialise errrors.
sourceraw docstring

dissocclj/s

(dissoc ?schema key)
(dissoc ?schema key options)

Like [[clojure.core/dissoc]], but for EntrySchemas.

Like [[clojure.core/dissoc]], but for EntrySchemas.
sourceraw docstring

distinct-byclj/s

(distinct-by f coll)

Returns a sequence of distinct (f x) values)

Returns a sequence of distinct (f x) values)
sourceraw docstring

explain-dataclj/s

(explain-data ?schema value)
(explain-data ?schema value options)

Explains a value against a given schema. Like m/explain but output is pure clojure data. Schema objects have been replaced with their m/form. Useful when you need to serialise errrors.

Creates the mu/data-explainer for every call. When performance matters, (re-)use mu/data-explainer instead.

Explains a value against a given schema. Like `m/explain` but output is pure clojure data.
Schema objects have been replaced with their `m/form`. Useful when you need to serialise errrors.

Creates the `mu/data-explainer` for every call. When performance matters, (re-)use `mu/data-explainer` instead.
sourceraw docstring

findclj/s

(find ?schema k)
(find ?schema k options)

Like [[clojure.core/find]], but for EntrySchemas.

Like [[clojure.core/find]], but for EntrySchemas.
sourceraw docstring

find-firstclj/s

(find-first ?schema f)
(find-first ?schema f options)

Prewalks the Schema recursively with a 3-arity fn [schema path options], returns with and as soon as the function returns non-null value.

Prewalks the Schema recursively with a 3-arity fn [schema path options], returns with
and as soon as the function returns non-null value.
sourceraw docstring

from-map-syntaxclj/s

(from-map-syntax m)
(from-map-syntax {:keys [type properties children] :as m} options)
source

getclj/s

(get ?schema k)
(get ?schema k default)
(get ?schema k default options)

Like [[clojure.core/get]], but for LensSchemas.

Like [[clojure.core/get]], but for LensSchemas.
sourceraw docstring

get-inclj/s

(get-in ?schema ks)
(get-in ?schema ks default)
(get-in ?schema [k & ks] default options)

Like [[clojure.core/get-in]], but for LensSchemas.

Like [[clojure.core/get-in]], but for LensSchemas.
sourceraw docstring

in->pathsclj/s

(in->paths schema in)

Returns a vector of schema paths for a given Schema and value path

Returns a vector of schema paths for a given Schema and value path
sourceraw docstring

keysclj/s

(keys ?schema)

Like [[clojure.core/keys]], but for EntrySchemas.

Like [[clojure.core/keys]], but for EntrySchemas.
sourceraw docstring

mergeclj/s

(merge ?schema1 ?schema2)
(merge ?schema1 ?schema2 options)

Merges two schemas into one with the following rules:

  • if either schemas is nil, the other one is used, regardless of value
  • with two :map schemas, both keys and values are merged
  • for :and schemas, the first child is used in merge, rest kept as-is
  • with two :map entries, :merge-entries fn is used (default last one wins)
  • with any other schemas, :merge-default fn is used (default last one wins)
keydescription
:merge-defaultschema1 schema2 options -> schema fn to merge unknown entries
:merge-requiredboolean boolean -> boolean fn to resolve how required keys are merged
Merges two schemas into one with the following rules:

* if either schemas is `nil`, the other one is used, regardless of value
* with two :map schemas, both keys and values are merged
* for :and schemas, the first child is used in merge, rest kept as-is
* with two :map entries, `:merge-entries` fn is used (default last one wins)
* with any other schemas, `:merge-default` fn is used (default last one wins)

| key               | description
| ------------------|-------------
| `:merge-default`  | `schema1 schema2 options -> schema` fn to merge unknown entries
| `:merge-required` | `boolean boolean -> boolean` fn to resolve how required keys are merged
sourceraw docstring

open-schemaclj/s

(open-schema ?schema)
(open-schema ?schema options)

Maps are implicitly open by default. They can be explicitly closed or open by specifying the {:closed (true|false)} property.

This function converts explicitly closed maps to implicitly open maps, recursively. Explicitly open maps are left untouched.

See closed-schema

Maps are implicitly open by default. They can be explicitly closed or
open by specifying the `{:closed (true|false)}` property.

This function converts explicitly closed maps to implicitly open
maps, recursively. Explicitly open maps are left untouched.

See [[closed-schema]]
sourceraw docstring

optional-keysclj/s

(optional-keys ?schema)
(optional-keys ?schema ?keys)
(optional-keys ?schema keys options)

Makes map keys optional.

Makes map keys optional.
sourceraw docstring

path->inclj/s

(path->in schema path)

Returns a value path for a given Schema and schema path

Returns a value path for a given Schema and schema path
sourceraw docstring

rename-keysclj/s

(rename-keys ?schema kmap)
(rename-keys ?schema kmap options)

Like [[clojure.set/rename-keys]], but for EntrySchemas. Collisions are resolved in favor of the renamed key, like assoc-ing.

Like [[clojure.set/rename-keys]], but for EntrySchemas. Collisions are resolved in favor of the renamed key, like `assoc`-ing.
sourceraw docstring

required-keysclj/s

(required-keys ?schema)
(required-keys ?schema ?keys)
(required-keys ?schema keys options)

Makes map keys required.

Makes map keys required.
sourceraw docstring

schemasclj/s

(schemas)
source

select-keysclj/s

(select-keys ?schema keys)
(select-keys ?schema keys options)

Like [[clojure.core/select-keys]], but for EntrySchemas.

Like [[clojure.core/select-keys]], but for EntrySchemas.
sourceraw docstring

subschemasclj/s

(subschemas ?schema)
(subschemas ?schema options)

Returns all subschemas for unique paths as a vector of maps with :schema, :path and :in keys. Walks over :schema references and top-level :refs. See [[malli.core/-walk]] for all options.

Returns all subschemas for unique paths as a vector of maps with :schema, :path and :in keys.
Walks over :schema references and top-level :refs. See [[malli.core/-walk]] for all options.
sourceraw docstring

to-map-syntaxclj/s

(to-map-syntax ?schema)
(to-map-syntax ?schema options)
source

transform-entriesclj/s

(transform-entries ?schema f)
(transform-entries ?schema f options)

Transforms entries with f.

Transforms entries with f.
sourceraw docstring

unionclj/s

(union ?schema1 ?schema2)
(union ?schema1 ?schema2 options)

Union of two schemas. See merge for more details.

Union of two schemas. See [[merge]] for more details.
sourceraw docstring

updateclj/s

(update schema key f & args)

Like [[clojure.core/update]], but for LensSchema instances.

Like [[clojure.core/update]], but for LensSchema instances.
sourceraw docstring

update-inclj/s

(update-in schema ks f & args)

Like [[clojure.core/update-in]], but for LensSchemas.

Like [[clojure.core/update-in]], but for LensSchemas.
sourceraw docstring

update-propertiesclj/s

(update-properties ?schema f & args)

Returns a Schema instance with updated properties.

Returns a Schema instance with updated properties.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close