(defn get-expander-ns [env ^String nstr]
;; first check for clojure.* -> cljs.* cases
(let [res (or (resolve-macro-ns-alias env nstr nil)
(resolve-ns-alias env nstr nil))
nstr (if (some? res) (str res) nstr)]
(cond
#?@(:clj [(= "clojure.core" nstr) (find-ns 'cljs.core)]
:cljs [(identical? "clojure.core" nstr) (find-macros-ns CLJS_CORE_MACROS_SYM)])
#?@(:clj [(= "clojure.repl" nstr) (find-ns 'cljs.repl)]
:cljs [(identical? "clojure.repl" nstr) (find-macros-ns 'cljs.repl)])
#?@(:clj [(.contains nstr ".") (find-ns (symbol nstr))]
:cljs [(goog.string/contains nstr ".") (find-macros-ns (symbol nstr))])
:else (some-> env :ns :require-macros (get (symbol nstr)) #?(:clj find-ns
:cljs find-macros-ns)))))