(defn dump-specs
"Dumps registered speced vars for a given namespace into the compiler
environment."
[ns]
(let [spec-vars (get-spec-vars)
ns-str (str ns)]
(swap! env/*compiler* update-in [::namespaces ns]
merge
(when-let [registry-ref (:registry-ref spec-vars)]
{:cljs.spec/registry-ref (into [] (filter (fn [[k _]] (= ns-str (namespace k)))) @@registry-ref)})
(when-let [speced-vars (:speced-vars spec-vars)]
{:cljs.spec/speced-vars (into [] (filter #(= ns-str (namespace %))) @@speced-vars)}))))