Liking cljdoc? Tell your friends :D

std.contract


as:maybeclj

(as:maybe v)

creates a maybe

creates a maybe
raw docstring

as:optionalclj

(as:optional k)

creates an optional

creates an optional
raw docstring

closedclj

(closed schema)

closes the map

closes the map
raw docstring

common-specclj

(common-spec sketch & more)

creates a common spec

creates a common spec
raw docstring

defcasecljmacro

(defcase sym dispatch sketch & more)

adds an additional case to the multispec

adds an additional case to the multispec
raw docstring

defcontractcljmacro

(defcontract sym & body)

defines a contract

(type/defspec <int> integer?)

(defcontract -add- :inputs [<int> <int>])

(-add- 0.5 0.5) => (throws)

defines a contract

(type/defspec <int> integer?)

(defcontract -add-
  :inputs [<int> <int>])

(-add- 0.5 0.5)
=> (throws)
raw docstring

defmultispeccljmacro

(defmultispec sym dispatch & pairs)

macro for defining a multispec

macro for defining a multispec
raw docstring

defspeccljmacro

(defspec sym sketch & more)

macro for defining a spec

macro for defining a spec
raw docstring

from-schemaclj

(from-schema schema)

sketch from schema

sketch from schema
raw docstring

funccljmacro

(func args)

macro for constructing a func

macro for constructing a func
raw docstring

laxclj

(lax schema)
(lax schema ks)

relaxes a map (optional keys and maybe vals)

relaxes a map (optional keys and maybe vals)
raw docstring

multi-specclj

(multi-spec dispatch options)

creates a multi spec

creates a multi spec
raw docstring

normclj

(norm schema)
(norm schema ks)

gets rid of optional keys

gets rid of optional keys
raw docstring

openedclj

(opened schema)

opens the map

opens the map
raw docstring

removeclj

(remove schema ks)

removes a key from map

removes a key from map
raw docstring

schemaclj

(schema ?schema)
(schema ?schema options)

Creates a Schema object from any of the following:

  • Schema instance (just returns it)
  • IntoSchema instance
  • Schema vector syntax, e.g. [:string {:min 1}]
  • Qualified Keyword or String, using a registry lookup
Creates a Schema object from any of the following:

- Schema instance (just returns it)
- IntoSchema instance
- Schema vector syntax, e.g. [:string {:min 1}]
- Qualified Keyword or String, using a registry lookup
raw docstring

schema?clj

(schema? x)

Checks if x is a Schema instance

Checks if x is a Schema instance
raw docstring

spec?clj

(spec? x)

checks that object is of type spec

checks that object is of type spec
raw docstring

tightenclj

(tighten schema)
(tighten schema ks)

tightens a map (no optionals or maybes)

tightens a map (no optionals or maybes)
raw docstring

to-schemaclj

(to-schema x)

converts object to schema

converts object to schema
raw docstring

valid?clj

(valid? spec data)

checks that data is valid

checks that data is valid
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