diff --git a/frontend/uxbox/schema.cljs b/frontend/uxbox/schema.cljs index 9d42ce96a..2ce54c44a 100644 --- a/frontend/uxbox/schema.cljs +++ b/frontend/uxbox/schema.cljs @@ -14,22 +14,31 @@ [v] (cljs.core/keyword? v)) - (v/defvalidator uuid "Validates maybe-an-int is a valid integer. For use with validation functions such as `validate` or `valid?`" - {:default-message-format "%s must be a uuid instance" - :optinal true} + {:default-message-format "%s must be a uuid instance"} [v] (instance? cljs.core.UUID v)) (v/defvalidator color "Validates if a string is a valid color." - {:default-message-format "%s must be a valid hex color" - :optional true} + {:default-message-format "%s must be a valid hex color"} [v] (not (nil? (re-find #"^#[0-9A-Fa-f]{6}$" v)))) +(v/defvalidator shape-type + "Validates if a keyword is a shape type." + {:default-message-format "%s must be a shape type keyword."} + [v] + (shape? v)) + +(v/defvalidator vector + "Validats if `v` is vector." + {:default-message-format "%s must be a vector instance."} + [v] + (vector? v)) + (def required v/required) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;