From d6e0001ac45395310b51516c803e381bc620f2ee Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 4 Jun 2025 12:12:31 +0200 Subject: [PATCH] :bug: Fix encoding and decoding issue with tokens lib type --- common/src/app/common/types/tokens_lib.cljc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index d02baf1375..73c6c0dd18 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -1255,8 +1255,11 @@ Will return a value that matches this schema: {:type ::tokens-lib :pred valid-tokens-lib? :type-properties - {:encode/json export-dtcg-json - :decode/json parse-multi-set-dtcg-json}})) + ;; NOTE: we can't assign statically at eval time the value of a + ;; function that is declared but not defined; so we need to pass + ;; an anonymous function and delegate the resolution to runtime + {:encode/json #(export-dtcg-json %) + :decode/json #(parse-multi-set-dtcg-json %)}})) (defn duplicate-set [set-name lib & {:keys [suffix]}] (let [sets (get-sets lib)