Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Jun 30, 2024
1 parent 49e8d88 commit aec024a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/reitit-core/src/reitit/impl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@

(defn -copy-meta [to from]
(letfn [(-with-meta [x m]
(try (with-meta x m) (catch #?(:clj Exception, :cljs js/Error) _)))
(try (with-meta x m)
(catch #?(:clj Exception, :cljs js/Error) _ x)))
(-copy [l p m]
(reduce-kv
(fn [l k v]
(let [p' (conj p k)
m' (meta (get-in from p'))]
m' (when (empty? (meta v))
(meta (get-in from p')))]
(cond
(and m' (not (var? v))) (update-in l p' -with-meta m')
m' (update-in l p' -with-meta m')
(and (map? v) (not (record? v)) (seq v)) (-copy l p' v)
:else l)))
l m))]
Expand Down

0 comments on commit aec024a

Please sign in to comment.