Skip to content

Instantly share code, notes, and snippets.

@aamedina
Last active December 27, 2015 12:09
Show Gist options
  • Select an option

  • Save aamedina/7324191 to your computer and use it in GitHub Desktop.

Select an option

Save aamedina/7324191 to your computer and use it in GitHub Desktop.
(defn fix-body
[kvs]
(-> (reduce-kv (fn [init k v]
(assoc init (clojure.string/replace (name k) #"-" "_") v))
{} kvs)
(clj->js)
(JSON.stringify)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment