Liking cljdoc? Tell your friends :D

representations.invariants


check-invariantsclj

(check-invariants edns)
(check-invariants edns additional-invariants)

Checks all invariants on a collection of EDNs. Always runs parse-valid first. For successfully parsed representations, runs the additional invariants provided (defaults to all remaining invariants).

Returns a seq of violation maps (or empty seq if all valid).

Each violation has:

  • :invariant/type - keyword identifying the invariant
  • :invariant/message - human-readable description
  • :invariant/offending - the offending EDN(s) or representation(s)
  • :invariant/data - additional data about the violation
Checks all invariants on a collection of EDNs.
Always runs parse-valid first. For successfully parsed representations,
runs the additional invariants provided (defaults to all remaining invariants).

Returns a seq of violation maps (or empty seq if all valid).

Each violation has:
- :invariant/type - keyword identifying the invariant
- :invariant/message - human-readable description
- :invariant/offending - the offending EDN(s) or representation(s)
- :invariant/data - additional data about the violation
raw docstring

no-dangling-refsclj

(no-dangling-refs representations)

Checks that every ref: has a corresponding representation with that :name. Returns a seq of violation maps, one per dangling ref (or empty seq if valid). Each violation includes :invariant/offending set with the representation that has the dangling ref. Takes already-parsed representations.

Checks that every ref: has a corresponding representation with that :name.
Returns a seq of violation maps, one per dangling ref (or empty seq if valid).
Each violation includes :invariant/offending set with the representation that has the dangling ref.
Takes already-parsed representations.
raw docstring

parse-validclj

(parse-valid edns)

Checks that all EDNs parse successfully. Returns a seq of violation maps, one per parse failure (or empty seq if all valid). Each violation includes :invariant/offending with the EDN that failed to parse.

Checks that all EDNs parse successfully.
Returns a seq of violation maps, one per parse failure (or empty seq if all valid).
Each violation includes :invariant/offending with the EDN that failed to parse.
raw docstring

same-versionclj

(same-version representations)

Checks that all representations have the same :version. Returns a seq with one violation if versions differ (or empty seq if valid). Takes already-parsed representations.

Checks that all representations have the same :version.
Returns a seq with one violation if versions differ (or empty seq if valid).
Takes already-parsed representations.
raw docstring

unique-namesclj

(unique-names representations)

Checks that all :name fields are unique across the collection. Returns a seq of violation maps, one per duplicate name (or empty seq if valid). Each violation includes :invariant/offending set of all representations with that name. Takes already-parsed representations.

Checks that all :name fields are unique across the collection.
Returns a seq of violation maps, one per duplicate name (or empty seq if valid).
Each violation includes :invariant/offending set of all representations with that name.
Takes already-parsed representations.
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