0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 22:49:01 -05:00

💄 Add minor cosmetic changes to common.spec ns

This commit is contained in:
Andrey Antukh 2023-02-01 16:36:41 +01:00
parent d666564112
commit 6240323704

View file

@ -201,18 +201,18 @@
(letfn [(conformer-fn [dest v]
(cond
(coll? v) (into dest non-empty-strings-xf v)
(coll? v) (into dest non-empty-strings-xf v)
(string? v) (into dest non-empty-strings-xf (str/split v #"[\s,]+"))
:else ::s/invalid))
(unformer-fn [v]
(str/join "," v))]
(s/def ::set-of-strings
(s/with-gen (s/conformer (partial conformer-fn #{}) unformer-fn)
#(tgen/set (s/gen ::not-empty-string))))
(-> (s/conformer (partial conformer-fn #{}) unformer-fn)
(s/with-gen #(tgen/set (s/gen ::not-empty-string)))))
(s/def ::vector-of-strings
(s/with-gen (s/conformer (partial conformer-fn []) unformer-fn)
#(tgen/vector (s/gen ::not-empty-string)))))
(-> (s/conformer (partial conformer-fn []) unformer-fn)
(s/with-gen #(tgen/vector (s/gen ::not-empty-string))))))
;; --- SPEC: set-of-valid-emails