Liking cljdoc? Tell your friends :D

types.unify

Unify experimental.lite schemas, vector schemas, and kv schemas. (kv schemas are just a simpler syntax for experimental.lite schemas.)

Unify experimental.lite schemas, vector schemas, and kv schemas.
(kv schemas are just a simpler syntax for experimental.lite schemas.)
raw docstring

->malliclj

(->malli s)
(->malli k v & kvs)

Return the standard form schema for s, if s is an experimental.lite schema, compiles s to a standard (vector form) schema first.

Otherwise return the vector form of s. The n-ary form accepts kvs and trasforms those into a map, which is then passed to the unary form.

The kvs arity builds an experimental.lite schema from the kvs, then calls itself with that schema.

Return the standard form schema for `s`, if `s` is an experimental.lite schema,
compiles `s` to a standard (vector form) schema first.

Otherwise return the vector form of `s`.  The n-ary form accepts kvs and trasforms those into
a map, which is then passed to the unary form.

The kvs arity builds an experimental.lite schema from the kvs, then calls itself with that
schema.
raw docstring

->schemaclj

(->schema s)
(->schema k v & kvs)

Normalize experimental.lite schema to a regular Malli schema if needed. Returns the compiled Malli schema object.

Here we define that experimental.lite schemas default to closed map types unless they contain a k/v {:forge.kvs/open true}. This can be easily added using the open-type helper function. (See the examples below.)

Unary form: a Malli schema in either regular or experimental.lite form. N-ary form: kv pairs that will be assembled into an experimental.lite schema before calling the unary form.

Normalize experimental.lite schema to a regular Malli schema if needed.
Returns the compiled Malli schema object.

Here we define that experimental.lite schemas default to closed map types
unless they contain a k/v {:forge.kvs/open true}.  This can be easily
added using the `open-type` helper function.  (See the examples below.)

Unary form: a Malli schema in either regular or experimental.lite form.
N-ary form: kv pairs that will be assembled into an experimental.lite
schema before calling the unary form.
raw docstring

default-valueclj

(default-value value s)

Transforms schema s to have a default value.

Transforms schema `s` to have a default `value`.
raw docstring

open-typeclj

(open-type s)

For a lite schema syntax map, adds metadata indicating that this schema represents an open type (additional unspecified kvs are permitted).

For a lite schema syntax map, adds metadata indicating that this schema
represents an open type (additional unspecified kvs are permitted).
raw docstring

optionalclj

Mark a value schema as an optional value.

Mark a value schema as an optional value.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close