mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 00:11:11 +00:00
.
This commit is contained in:
parent
aec024a943
commit
e8c3035254
1 changed files with 2 additions and 4 deletions
|
|
@ -36,14 +36,12 @@
|
||||||
|
|
||||||
(defn -copy-meta [to from]
|
(defn -copy-meta [to from]
|
||||||
(letfn [(-with-meta [x m]
|
(letfn [(-with-meta [x m]
|
||||||
(try (with-meta x m)
|
(try (with-meta x m) (catch #?(:clj Exception, :cljs js/Error) _ x)))
|
||||||
(catch #?(:clj Exception, :cljs js/Error) _ x)))
|
|
||||||
(-copy [l p m]
|
(-copy [l p m]
|
||||||
(reduce-kv
|
(reduce-kv
|
||||||
(fn [l k v]
|
(fn [l k v]
|
||||||
(let [p' (conj p k)
|
(let [p' (conj p k)
|
||||||
m' (when (empty? (meta v))
|
m' (when (empty? (meta v)) (meta (get-in from p')))]
|
||||||
(meta (get-in from p')))]
|
|
||||||
(cond
|
(cond
|
||||||
m' (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)
|
(and (map? v) (not (record? v)) (seq v)) (-copy l p' v)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue