function | since v0.0-927 | ![]() | Edit |
(keywordize-keys m)
Recursively transforms all map keys from strings to keywords.
(defn keywordize-keys
{:added "1.1"}
[m]
(let [f (fn [[k v]] (if (string? k) [(keyword k) v] [k v]))]
;; only apply to maps
(postwalk (fn [x] (if (map? x) (into {} (map f x)) x)) m)))