Skip to content

Commit

Permalink
Removed redundant calls to s/nillable
Browse files Browse the repository at this point in the history
  • Loading branch information
maacl committed Dec 27, 2018
1 parent 4f3bf14 commit 553bcfc
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions README.md
Expand Up @@ -183,16 +183,14 @@ For simple transformations, there is `coerce`. It takes a spec, value and a tran
(s/def ::c2 keyword?)

(st/coerce
(s/nilable
(s/nilable
(s/map-of
keyword?
(s/or :keys (s/keys :req-un [::c1])
:ks (s/coll-of (s/and int?) :into #{})))))
{"keys" {:c1 "1" ::c2 "kikka"}
"keys2" {:c1 true}
"ints" [1 "1" "invalid" "3"]}
st/string-transformer)
(s/map-of
keyword?
(s/or :keys (s/keys :req-un [::c1])
:ks (s/coll-of (s/and int?) :into #{})))
{"keys" {:c1 "1" ::c2 "kikka"}
"keys2" {:c1 true}
"ints" [1 "1" "invalid" "3"]}
st/string-transformer)
;{:keys {:c1 1, ::c2 :kikka}
; :keys2 {:c1 true}
; :ints #{1 "invalid" 3}}
Expand Down

0 comments on commit 553bcfc

Please sign in to comment.