0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Skip parsing on numbers

This commit is contained in:
Florian Schroedl 2024-08-08 11:07:24 +02:00
parent 0684d893e0
commit 31674db11d

View file

@ -8,10 +8,11 @@
#"^\s*(-?[0-9]+\.?[0-9]*)\s*$")
(defn parse-token-value [value]
(when (string? value)
(when-let [double-str (-> (re-find parseable-token-value-regexp value)
(last))]
(d/parse-double double-str))))
(cond
(number? value) value
(string? value) (when-let [double-str (-> (re-find parseable-token-value-regexp value)
(last))]
(d/parse-double double-str))))
(defn find-token-references
"Finds token reference values in `value-string` and returns a set with all contained namespaces."