mirror of
https://github.com/penpot/penpot.git
synced 2025-02-23 15:26:29 -05:00
⚡ Declare transducer statically for path split function
This commit is contained in:
parent
df6a679548
commit
baa5258a43
1 changed files with 6 additions and 4 deletions
|
@ -26,13 +26,15 @@
|
||||||
(def valid-groupable-item?
|
(def valid-groupable-item?
|
||||||
(sm/validator schema:groupable-item))
|
(sm/validator schema:groupable-item))
|
||||||
|
|
||||||
|
(def ^:private xf:clean-string
|
||||||
|
(comp (map str/trim)
|
||||||
|
(remove str/empty?)))
|
||||||
|
|
||||||
(defn split-path
|
(defn split-path
|
||||||
"Decompose a string in the form 'one.two.three' into a vector of strings, removing spaces."
|
"Decompose a string in the form 'one.two.three' into a vector of strings, removing spaces."
|
||||||
[path separator]
|
[path separator]
|
||||||
(let [xf (comp (map str/trim)
|
(->> (str/split path separator)
|
||||||
(remove str/empty?))]
|
(into [] xf:clean-string)))
|
||||||
(->> (str/split path separator)
|
|
||||||
(into [] xf))))
|
|
||||||
|
|
||||||
(defn join-path
|
(defn join-path
|
||||||
"Regenerate a path as a string, from a vector."
|
"Regenerate a path as a string, from a vector."
|
||||||
|
|
Loading…
Add table
Reference in a new issue