Skip to content

Commit b132dd7

Browse files
committed
Merge branch 'master' into new-destructure
2 parents a4f94bc + b9cf3c8 commit b132dd7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/main/cljs/cljs/core.cljs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5254,6 +5254,16 @@ reduces them without incurring seq initialization"
52545254
([f] (lazy-seq (cons (f) (repeatedly f))))
52555255
([n f] (take n (repeatedly f))))
52565256

5257+
(defn some-vals
5258+
"Returns a map with only the non-nil values of map m. Returns nil if
5259+
m has no non-nil vals."
5260+
{:added "1.13"
5261+
:static true}
5262+
[m]
5263+
(reduce-kv
5264+
(fn [m k v] (if (some? v) (assoc m k v) m))
5265+
nil m))
5266+
52575267
(def ^:private UNREALIZED-SEED #js {})
52585268

52595269
(deftype Iterate [meta f prev-seed ^:mutable seed ^:mutable next]

0 commit comments

Comments
 (0)