(defn munge-param-return [env line]
(cond
(re-find #"@param" line)
(let [[p ts n & xs] (map string/trim
(string/split (string/trim line) #" "))]
(if (and (= "@param" p)
ts #?(:clj (.startsWith ^String ts "{")
:cljs (gstring/startsWith ts "{")))
(string/join " " (concat [p (resolve-types env ts) (munge n)] xs))
line))
(re-find #"@return" line)
(let [[p ts & xs] (map string/trim
(string/split (string/trim line) #" "))]
(if (and (= "@return" p)
ts #?(:clj (.startsWith ^String ts "{")
:cljs (gstring/startsWith ts "{")))
(string/join " " (concat [p (resolve-types env ts)] xs))
line))
:else line))