hey hey ๐ How would I return a map where all paths that donโt terminate in an integer have been pruned? Given:
{:a {:b {:c 10
:d ""}}
:f 5
:k [10]
:m ""
:x {:y {:z ""}}}
I want:
{:a {:b {:c 10}}
:f 5
:k [10]}
@nonrecursive you can do that with a custom walker and compact
:
(def COMPACTING-WALKER
(recursive-path [] p
(cond-path map? [(compact MAP-VALS) p]
coll? [(compact ALL) p]
STAY STAY
)))
(setval [COMPACTING-WALKER (complement number?)]
NONE
data
)