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?
|
||||
(sm/validator schema:groupable-item))
|
||||
|
||||
(def ^:private xf:clean-string
|
||||
(comp (map str/trim)
|
||||
(remove str/empty?)))
|
||||
|
||||
(defn split-path
|
||||
"Decompose a string in the form 'one.two.three' into a vector of strings, removing spaces."
|
||||
[path separator]
|
||||
(let [xf (comp (map str/trim)
|
||||
(remove str/empty?))]
|
||||
(->> (str/split path separator)
|
||||
(into [] xf))))
|
||||
(into [] xf:clean-string)))
|
||||
|
||||
(defn join-path
|
||||
"Regenerate a path as a string, from a vector."
|
||||
|
|
Loading…
Add table
Reference in a new issue