Skip to content

Instantly share code, notes, and snippets.

@danielytics
Created January 6, 2016 13:05
Show Gist options
  • Save danielytics/d814d7d3c5efa655d902 to your computer and use it in GitHub Desktop.
Save danielytics/d814d7d3c5efa655d902 to your computer and use it in GitHub Desktop.
postwalk comes from clojure.walk/postwalk (namespace might be cljs.walk in cljs, you'll have to check)
may need to look at prewalk, i didn't test so dunno. also didn't pay attention to which (pre or post) is more efficient in this case (if they both work)
(postwalk
(fn [item]
(let [t (:type item)]
(if (or (not (map? item))
(nil? t)
(= t filter-type))
item
nil)))
nested-maps)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment