Deprecate replace-all-matching-values-by-new-value
in favor or 'replace-all-matching' as it is shorter
This commit is contained in:
parent
b4eb47d584
commit
2008322368
1 changed files with 14 additions and 6 deletions
|
@ -42,15 +42,23 @@
|
||||||
%)
|
%)
|
||||||
coll))
|
coll))
|
||||||
|
|
||||||
(defn-spec replace-all-matching-values-by-new-value cp/map-or-seq?
|
(defn-spec replace-all-matching cp/map-or-seq?
|
||||||
|
[coll cp/map-or-seq?
|
||||||
|
match-value string?
|
||||||
|
replace-value cp/str-or-number?]
|
||||||
|
(clojure.walk/postwalk #(if (and (= (type value-to-match) (type %))
|
||||||
|
(= value-to-match %))
|
||||||
|
value-to-replace
|
||||||
|
%)
|
||||||
|
coll))
|
||||||
|
|
||||||
|
|
||||||
|
(defn-spec ^{:deprecated "6.2.4"} replace-all-matching-values-by-new-value cp/map-or-seq?
|
||||||
|
"Use replace-all-matching instead"
|
||||||
[coll cp/map-or-seq?
|
[coll cp/map-or-seq?
|
||||||
value-to-match string?
|
value-to-match string?
|
||||||
value-to-replace cp/str-or-number?]
|
value-to-replace cp/str-or-number?]
|
||||||
(clojure.walk/postwalk #(if (and (= (type value-to-match) (type %))
|
(replace-all-matching coll value-to-match value-to-replace))
|
||||||
(= value-to-match %))
|
|
||||||
value-to-replace
|
|
||||||
%)
|
|
||||||
coll))
|
|
||||||
|
|
||||||
(defn-spec concat-vec vector?
|
(defn-spec concat-vec vector?
|
||||||
[& vs (s/* cp/string-sequence?)]
|
[& vs (s/* cp/string-sequence?)]
|
||||||
|
|
Loading…
Reference in a new issue