mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
✨ Improve decode empty string for path content
This commit is contained in:
@@ -117,6 +117,7 @@
|
||||
[:ref-id {:optional true} ::sm/uuid]
|
||||
[:ref-file {:optional true} ::sm/uuid]])
|
||||
|
||||
;; This schema represent an "applied color"
|
||||
(def schema:color
|
||||
[:and
|
||||
[:merge {:title "Color"}
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
[app.common.schema.generators :as sg]
|
||||
[app.common.svg.path :as svg.path]
|
||||
[app.common.transit :as t]
|
||||
[app.common.types.path :as-alias path])
|
||||
[app.common.types.path :as-alias path]
|
||||
[cuerdas.core :as str])
|
||||
(:import
|
||||
#?(:cljs [goog.string StringBuffer]
|
||||
:clj [java.nio ByteBuffer ByteOrder])))
|
||||
@@ -530,7 +531,9 @@
|
||||
:decode/json (fn [s]
|
||||
(cond
|
||||
(string? s)
|
||||
(from-string s)
|
||||
(if (str/empty? s)
|
||||
(from-plain [])
|
||||
(from-string s))
|
||||
|
||||
(vector? s)
|
||||
(let [decode-fn (deref decoder)]
|
||||
|
||||
Reference in New Issue
Block a user