♻️ Apply transducer-fu

This commit is contained in:
Andrés Moya 2021-05-31 13:15:42 +02:00
parent b2fef7b7a8
commit ebc79c278b

View file

@ -410,10 +410,10 @@
"Decompose a string in the form 'one / two / three' into "Decompose a string in the form 'one / two / three' into
a vector of strings, normalizing spaces." a vector of strings, normalizing spaces."
[path] [path]
(let [xf (comp (map str/trim)
(remove str/empty?))]
(->> (str/split path "/") (->> (str/split path "/")
(map str/trim) (into [] xf))))
(remove str/empty?)
vec))
(defn join-path (defn join-path
"Regenerate a path as a string, from a vector." "Regenerate a path as a string, from a vector."