macro | previously cljs.spec/every-kv | clojure.spec.alpha/every-kv | Edit |
(every-kv kpred vpred & opts)
like 'every' but takes separate key and val preds and works on associative collections. Same options as 'every', :into defaults to {} See also - map-of
(defmacro every-kv
[kpred vpred & opts]
(let [desc `(every-kv ~(res &env kpred) ~(res &env vpred) ~@(res-kind &env opts))]
`(every (tuple ~kpred ~vpred) ::kfn (fn [i# v#] (nth v# 0)) :into {} ::describe '~desc ~@opts)))