Skip to content

Commit 8ceb204

Browse files
itoooofederkasten
authored andcommitted
fix: to prevent errors occuring when merging non-map value
1 parent 6e6f465 commit 8ceb204

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/cljc/proton/core.cljc

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
"Recursively merges maps."
199199
[& maps]
200200
(letfn [(m [& xs]
201-
(if (some #(and (map? %) (not (record? %))) xs)
201+
(if (every? #(and (map? %) (not (record? %))) xs)
202202
(apply merge-with m xs)
203203
(last xs)))]
204204
(reduce m maps)))

test/proton/core_test.cljc

+3-1
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,6 @@
161161
(is (= (core/deep-merge {:foo {:bar 1}} {:foo {:baz 2}})
162162
{:foo {:bar 1 :baz 2}}))
163163
(is (= (core/deep-merge {:foo {:bar 1}} {:baz 2})
164-
{:foo {:bar 1} :baz 2})))
164+
{:foo {:bar 1} :baz 2}))
165+
(is (= (core/deep-merge {:foo 1} {:foo {:baz 2}})
166+
{:foo {:baz 2}})))

0 commit comments

Comments
 (0)