From 0d154679e9f6dc52c13518a63c148cd1efa4b967 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Thu, 16 May 2024 09:44:11 +0200 Subject: [PATCH] Add docstrings --- frontend/src/app/main/ui/workspace/tokens/core.cljs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/core.cljs b/frontend/src/app/main/ui/workspace/tokens/core.cljs index d502ae4aa..20eebea40 100644 --- a/frontend/src/app/main/ui/workspace/tokens/core.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/core.cljs @@ -44,12 +44,18 @@ (group-by :type))) (defn tokens-name-map - "Convert tokens into a map with their `:name` as the key." + "Convert tokens into a map with their `:name` as the key. + + E.g.: {\"sm\" {:token-type :border-radius :id #uuid \"000\" ...}}" [tokens] (->> (map (fn [{:keys [name] :as token}] [name token]) tokens) (into {}))) -(defn tokens-name-map-for-type [token-type tokens] +(defn tokens-name-map-for-type + "Convert tokens with `token-type` into a map with their `:name` as the key. + + E.g.: {\"sm\" {:token-type :border-radius :id #uuid \"000\" ...}}" + [token-type tokens] (-> (group-tokens-by-type tokens) (get token-type []) (tokens-name-map)))