From 44e4e852017c5cbfd844bf246a30cbf3cde58a66 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 24 Sep 2024 11:10:07 +0200 Subject: [PATCH] Add schema validation --- common/src/app/common/types/tokens_lib.cljc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index 41ccce46e..83b1174a8 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -348,6 +348,12 @@ (def check-token-themes! (sm/check-fn ::token-themes)) +(def schema:active-token-themes + [:set string?]) + +(def valid-active-token-themes? + (sm/validator schema:active-token-themes)) + ;; === Tokens Lib (defprotocol ITokensLib @@ -564,7 +570,8 @@ (validate [_] (and (valid-token-sets? sets) ;; TODO: validate set-groups - (valid-token-themes? themes)))) + (valid-token-themes? themes) + (valid-active-token-themes? active-themes)))) (defn valid-tokens-lib? [o]