Liking cljdoc? Tell your friends :D

malli.destructure


-any?clj/s

(-any? x)
source

-createclj/s

(-create inline-schemas)
source

-function-schemaclj/s

(-function-schema arglists)
(-function-schema arglists options)
source

-keysclj/s

(-keys
  {:keys [keys strs syms] :as arg}
  {:keys [:malli.destructure/references] :or {references true} :as options})
source

-mapclj/s

(-map arg
      {:keys [:malli.destructure/references :malli.destructure/required-keys
              :malli.destructure/closed-maps :malli.destructure/sequential-maps]
       :or {references true sequential-maps true}
       :as options}
      rest)
source

-map-like?clj/s

(-map-like? x)
source

-maybe?clj/s

(-maybe? x)
source

-qualified-key?clj/s

(-qualified-key? k)
source

-qualified-keysclj/s

(-qualified-keys m)
source

-schemaclj/s

(-schema {:keys [elems rest]} options)
source

-transformclj/s

(-transform {[k v] :arg schema :schema :as all} options rest)
source

-unschematizeclj/s

(-unschematize x)
source

-vectorclj/s

(-vector {:keys [as elems rest]} options)
source

Bindingclj/s

source

inferclj/s

(infer var)
(infer var options)

Infers a schema from a function Var. Best effort.

Infers a schema from a function Var. Best effort.
sourceraw docstring

MapLikeclj/s

source

Neverclj/s

source

parseclj/s

(parse arglist)
(parse arglist
       {:keys [:malli.destructure/inline-schemas]
        :or {inline-schemas true}
        :as options})

Takes a destructuring bindings vector (arglist) and returns a map with keys:

keydescription
:raw-arglistthe original arglist (can have type-hints)
:arglistsimplified clojure arglist (no type-hints)
:schemaextracted malli schema
:parsedfull parse results

Parsing can be configured using the following options:

keydescription
::md/inline-schemassupport plumatic-style inline schemas (true)
::md/sequential-mapssupport sequential maps in non-rest position (true)
::md/referencesqualified schema references used (true)
::md/required-keysdestructured keys are required (false)
::md/closed-mapsdestructured maps are closed (false)

Examples:

(require '[malli.destructure :as md])

(-> '[a b & cs] (md/parse) :schema) ; => [:cat :any :any [:* :any]]

(-> '[a :- :string, b & cs :- [:* :int]] (md/parse) :schema) ; => [:cat :string :any [:* :int]]

Takes a destructuring bindings vector (arglist)
and returns a map with keys:

| key            | description |
| ---------------|-------------|
| `:raw-arglist` | the original arglist (can have type-hints)
| `:arglist`     | simplified clojure arglist (no type-hints)
| `:schema`      | extracted malli schema
| `:parsed`      | full parse results

Parsing can be configured using the following options:

| key                    | description |
| -----------------------|-------------|
| `::md/inline-schemas`  | support plumatic-style inline schemas (true)
| `::md/sequential-maps` | support sequential maps in non-rest position (true)
| `::md/references`      | qualified schema references used (true)
| `::md/required-keys`   | destructured keys are required (false)
| `::md/closed-maps`     | destructured maps are closed (false)

Examples:

   (require '[malli.destructure :as md])

   (-> '[a b & cs] (md/parse) :schema)
   ; => [:cat :any :any [:* :any]]

   (-> '[a :- :string, b & cs :- [:* :int]] (md/parse) :schema)
   ; => [:cat :string :any [:* :int]]
sourceraw docstring

SchematizedBindingclj/s

source

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

× close