Skip to content

Instantly share code, notes, and snippets.

@transducer
Created August 26, 2016 13:57
Show Gist options
  • Select an option

  • Save transducer/0e725582311454d61bbd7f3a29b2a8d4 to your computer and use it in GitHub Desktop.

Select an option

Save transducer/0e725582311454d61bbd7f3a29b2a8d4 to your computer and use it in GitHub Desktop.
(defn modify-keys [f m] (zipmap (map f (keys m)) (vals m)))
(defn prefix-with-ns [coll]
(modify-keys
#(keyword (str "spec.core/" (clojure.string/replace (str %) ":" "")))
coll))
(def my-json (prefix-with-ns (json/read-json "{\"yes\": \"yes\"}" ))) ; => {:yes "yes"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment