mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 22:22:43 -05:00
Add docstrings
This commit is contained in:
parent
c60c5ac34f
commit
0d154679e9
1 changed files with 8 additions and 2 deletions
|
@ -44,12 +44,18 @@
|
||||||
(group-by :type)))
|
(group-by :type)))
|
||||||
|
|
||||||
(defn tokens-name-map
|
(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]
|
[tokens]
|
||||||
(->> (map (fn [{:keys [name] :as token}] [name token]) tokens)
|
(->> (map (fn [{:keys [name] :as token}] [name token]) tokens)
|
||||||
(into {})))
|
(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)
|
(-> (group-tokens-by-type tokens)
|
||||||
(get token-type [])
|
(get token-type [])
|
||||||
(tokens-name-map)))
|
(tokens-name-map)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue