Skip to content

Instantly share code, notes, and snippets.

@wilkerlucio
Last active June 2, 2017 14:28
Show Gist options
  • Save wilkerlucio/bd8725ca007734f46cf14e9b26526644 to your computer and use it in GitHub Desktop.
Save wilkerlucio/bd8725ca007734f46cf14e9b26526644 to your computer and use it in GitHub Desktop.
Specter - walk map keys
(def data
{:person/name "Bla"
:person/child {:child/something "other"
:child/bla {:subchild/entry "blabla"}}})
(def MapWalker
(sp/recursive-path [] p
(sp/if-path map?
(sp/continue-then-stay sp/MAP-VALS p))))
(sp/setval [MapWalker sp/MAP-KEYS sp/NAMESPACE] nil data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment