There was an error while loading. Please reload this page.
1 parent a74e3b4 commit 9b044f7Copy full SHA for 9b044f7
1 file changed
src/malli/instrument.clj
@@ -52,7 +52,18 @@
52
(defn clj-collect!
53
([] (clj-collect! {:ns *ns*}))
54
([{:keys [ns]}]
55
- (not-empty (reduce (fn [acc v] (let [v (-collect! v)] (cond-> acc v (conj v)))) #{} (vals (mapcat ns-publics (-sequential ns)))))))
+ (not-empty
56
+ (reduce (fn [acc nspace] ns-publics
57
+ (let [nspace (the-ns nspace)]
58
+ (reduce-kv (fn [acc _ ^clojure.lang.Var v]
59
+ (if-let [v (and (instance? clojure.lang.Var v)
60
+ (= nspace (.ns v))
61
+ (not (:private (meta v)))
62
+ (-collect! v))]
63
+ (conj acc v)
64
+ acc))
65
+ acc (ns-map nspace))))
66
+ #{} (-sequential ns)))))
67
68
;;
69
;; CLJS macro for collecting function schemas
0 commit comments