-
Notifications
You must be signed in to change notification settings - Fork 24
/
specs.cljc
35 lines (32 loc) · 1.77 KB
/
specs.cljc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
(ns expound.specs
(:require [expound.alpha :as ex]
[clojure.spec.alpha :as s]))
;;;; public specs ;;;;;;
(ex/def ::bool boolean? "should be either true or false")
#?(:clj (ex/def ::bytes bytes? "should be an array of bytes"))
(ex/def ::double double? "should be a double")
(ex/def ::ident ident? "should be an identifier (a symbol or keyword)")
(ex/def ::indexed indexed? "should be an indexed collection")
(ex/def ::int int? "should be an integer")
(ex/def ::kw keyword? "should be a keyword")
(ex/def ::map map? "should be a map")
(ex/def ::nat-int nat-int? "should be an integer equal to, or greater than, zero")
(ex/def ::neg-int neg-int? "should be a negative integer")
(ex/def ::pos-int pos-int? "should be a positive integer")
(ex/def ::qualified-ident qualified-ident? "should be an identifier (a symbol or keyword) with a namespace")
(ex/def ::qualified-kw qualified-keyword? "should be a keyword with a namespace")
(ex/def ::qualified-sym qualified-symbol? "should be a symbol with a namespace")
(ex/def ::seqable seqable? "should be a seqable collection")
(ex/def ::simple-ident simple-ident? "should be an identifier (a symbol or keyword) with no namespace")
(ex/def ::simple-kw simple-keyword? "should be a keyword with no namespace")
(ex/def ::simple-sym simple-symbol? "should be a symbol with no namespace")
(ex/def ::str string? "should be a string")
(ex/def ::sym symbol? "should be a symbol")
(ex/def ::uri uri? "should be a URI")
(ex/def ::uuid uuid? "should be a UUID")
(ex/def ::vec vector? "should be a vector")
(def public-specs
[::bool #?(:clj ::bytes) ::double ::ident ::indexed ::int ::kw
::map ::nat-int ::neg-int ::pos-int ::qualified-ident
::qualified-kw ::qualified-sym ::seqable ::simple-ident
::simple-kw ::simple-sym ::str ::sym ::uuid ::uri ::vec])