File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ merged with the internal registry at coerce time.
44
44
45
45
``` clj
46
46
(s/def ::foo keyword? )
47
- (c/coerce ::foo " bar" {::c/ idents {::foo (fn [x opts] (str " keyword:" x))}}) -> " keyword:bar"
47
+ (c/coerce ::foo " bar" {:idents {::foo (fn [x opts] (str " keyword:" x))}}) -> " keyword:bar"
48
48
```
49
49
50
50
Coercers are functions of 2 args, the value, and the options coerce
@@ -60,7 +60,7 @@ The typical example would be :
60
60
``` clj
61
61
(s/def ::foo (s/coll-of keyword?))
62
62
; ; we'll namespace all keywords in that coll-of
63
- (c/coerce ::foo [" a" " b" ] {::c/ idents {`keyword? (fn [x opts] (keyword " foo" x)}) }) -> [foo/a foo/b]
63
+ (c/coerce ::foo [" a" " b" ] {:idents {`keyword? (fn [x opts] (keyword " foo" x))} }) -> [foo/a foo/b]
64
64
```
65
65
66
66
You can specify multiple overrides per coerce call.
@@ -72,7 +72,7 @@ easily for instance generate open-api definitions using these.
72
72
73
73
``` clj
74
74
(c/coerce ::foo (s/coll-of keyword?)
75
- {::c/ forms {`s/coll-of (fn [[_ spec]] (fn [x opts] (do-something-crazy-with-spec+the-value spec x opts)))}})
75
+ {:forms {`s/coll-of (fn [[_ spec]] (fn [x opts] (do-something-crazy-with-spec+the-value spec x opts)))}})
76
76
```
77
77
78
78
### Closed maps
Original file line number Diff line number Diff line change 293
293
:unqualified 12
294
294
:sub {::infer-int 42 }}))
295
295
(is (= (sc/coerce-structure {::or-example " 321" }
296
- {::sc/ op sc/conform})
296
+ {:op sc/conform})
297
297
{::or-example [:int 321 ]}))
298
298
299
299
(defrecord SomeRec [a])
430
430
(is (= {::x :y/quux }
431
431
(sc/coerce ::mm
432
432
{::x " quux" }
433
- {::sc/ cache? false }))))
433
+ {:cache? false }))))
434
434
435
435
(def d :kw )
436
436
; ; no vars in cljs
You can’t perform that action at this time.
0 commit comments