mirror of
https://github.com/penpot/penpot.git
synced 2025-07-24 13:27:14 +02:00
WIP
This commit is contained in:
parent
56f7613453
commit
6b6aba7358
8 changed files with 258 additions and 37 deletions
|
@ -1,5 +1,5 @@
|
|||
(ns uxbox.schema
|
||||
(:refer-clojure :exclude [keyword?])
|
||||
(:refer-clojure :exclude [keyword uuid])
|
||||
(:require [bouncer.core :as b]
|
||||
[bouncer.validators :as v]))
|
||||
|
||||
|
@ -7,13 +7,21 @@
|
|||
;; Validators
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(v/defvalidator keyword?
|
||||
(v/defvalidator keyword
|
||||
"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 keyword"}
|
||||
[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"}
|
||||
[v]
|
||||
(instance? cljs.core.UUID v))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Public Api
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue