Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/malli/instrument.clj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,18 @@
(defn clj-collect!
([] (clj-collect! {:ns *ns*}))
([{:keys [ns]}]
(not-empty (reduce (fn [acc v] (let [v (-collect! v)] (cond-> acc v (conj v)))) #{} (vals (mapcat ns-publics (-sequential ns)))))))
(not-empty
(reduce (fn [acc nspace] ns-publics
Comment thread
alexander-yakushev marked this conversation as resolved.
Outdated
(let [nspace (the-ns nspace)]
(reduce-kv (fn [acc _ ^clojure.lang.Var v]
(if-let [v (and (instance? clojure.lang.Var v)
(= nspace (.ns v))
(not (:private (meta v)))
(-collect! v))]
(conj acc v)
acc))
acc (ns-map nspace))))
#{} (-sequential ns)))))

;;
;; CLJS macro for collecting function schemas
Expand Down