Created
January 6, 2016 13:05
-
-
Save danielytics/d814d7d3c5efa655d902 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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