Skip to content

Instantly share code, notes, and snippets.

@missingfaktor
Last active December 16, 2015 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save missingfaktor/5382262 to your computer and use it in GitHub Desktop.
Save missingfaktor/5382262 to your computer and use it in GitHub Desktop.
(defn >props-seq
([props-map carry out]
(reduce
(fn [coll [k v]]
(let [carry-str (if carry (str carry ".") "")
prefix (str carry-str (name k))]
(if (map? v)
(concat coll (>props-seq v prefix []))
(conj coll [prefix v]))))
out
props-map))
([props]
(>props-seq props nil [])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment