0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 14:12:36 -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*$") #"^\s*(-?[0-9]+\.?[0-9]*)\s*$")
(defn parse-token-value [value] (defn parse-token-value [value]
(when (string? value) (cond
(when-let [double-str (-> (re-find parseable-token-value-regexp value) (number? value) value
(last))] (string? value) (when-let [double-str (-> (re-find parseable-token-value-regexp value)
(d/parse-double double-str)))) (last))]
(d/parse-double double-str))))
(defn find-token-references (defn find-token-references
"Finds token reference values in `value-string` and returns a set with all contained namespaces." "Finds token reference values in `value-string` and returns a set with all contained namespaces."