(defn register-specs
"Registers speced vars found in a namespace analysis cache."
[cached-ns]
#?(:clj (try
(locking load-mutex
(clojure.core/require 'cljs.spec.alpha))
(catch Throwable t)))
(let [{:keys [registry-ref speced-vars]} (get-spec-vars)]
(when-let [registry (seq (:cljs.spec/registry-ref cached-ns))]
(when registry-ref
(swap! @registry-ref merge registry)))
(when-let [vars (seq (:cljs.spec/speced-vars cached-ns))]
(when speced-vars
(swap! @speced-vars into vars)))))