Reusable specs and spec-related utilities, common to web apps.
Reusable specs and spec-related utilities, common to web apps.
(->boolean s)
Spec predicate: conform to Boolean else invalid.
Spec predicate: conform to Boolean else invalid.
(->date s)
Spec predicate: conform to Date else invalid.
Spec predicate: conform to Date else invalid.
(->date-time s)
Spec predicate: conform to Date else invalid.
Spec predicate: conform to Date else invalid.
(->double s)
Spec predicate: conform to Double else invalid.
Spec predicate: conform to Double else invalid.
(->long s)
Spec predicate: conform to Long else invalid.
Spec predicate: conform to Long else invalid.
(coerce->date s)
Given a string or date, produce a date, or throw an exception. Low level utility used by spec predicates to accept either a date or a string that can be converted to a date.
Given a string or date, produce a date, or throw an exception. Low level utility used by spec predicates to accept either a date or a string that can be converted to a date.
(coerce->date-time s)
Given a string or date, produce a date-time, or throw an exception. Low level utility used by spec predicates to accept either a date or a string that can be converted to a date-time.
Given a string or date, produce a date-time, or throw an exception. Low level utility used by spec predicates to accept either a date or a string that can be converted to a date-time.
(coerce->double s)
Given a string or number, produce a double, or throw an exception. Low level utility used by spec predicates to accept either a number or a string that can be converted to a number.
Given a string or number, produce a double, or throw an exception. Low level utility used by spec predicates to accept either a number or a string that can be converted to a number.
(coerce->long s)
Given a string or number, produce a long, or throw an exception. Low level utility used by spec predicates to accept either a number or a string that can be converted to a number.
Given a string or number, produce a long, or throw an exception. Low level utility used by spec predicates to accept either a number or a string that can be converted to a number.
(opt-param-spec coerce str-or-spec & [spec])
Given a coercion function and a predicate / spec, produce a spec that accepts strings that can be coerced to a value that satisfies the predicate / spec, and will also generate strings that conform to the given spec. An empty string is coerced to nil; a generated nil produces the empty string.
Given a coercion function and a predicate / spec, produce a spec that accepts strings that can be coerced to a value that satisfies the predicate / spec, and will also generate strings that conform to the given spec. An empty string is coerced to nil; a generated nil produces the empty string.
(param-spec coerce str-or-spec & [spec])
Given a coercion function and a predicate / spec, produce a spec that accepts strings that can be coerced to a value that satisfies the predicate / spec, and will also generate strings that conform to the given spec.
Given a coercion function and a predicate / spec, produce a spec that accepts strings that can be coerced to a value that satisfies the predicate / spec, and will also generate strings that conform to the given spec.
(split->longs s)
Spec predicate: conform string to collection of Long. Also accepts a collection of numbers.
Spec predicate: conform string to collection of Long. Also accepts a collection of numbers.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close