Abstract into helper

This commit is contained in:
Florian Schroedl
2024-07-04 10:00:44 +02:00
parent e85de19a5e
commit 581ced0ab8
2 changed files with 7 additions and 2 deletions

View File

@@ -2,6 +2,12 @@
(:require
[cuerdas.core :as str]))
(defn attributes-map
"Creats an attributes map using collection of `attributes` for `id`."
[attributes id]
(->> (map (fn [attr] {attr id}) attributes)
(into {})))
(defn token-applied?
"Test if `token` is applied to a `shape` with the given `token-attributes`."
[token shape token-attributes]