Fork me on GitHub
#specter
<
2020-02-05
>
akond06:02:22

(let [data {:data {:a [1 2 3] :b [{:foo :bar}]}}]
 (is (= (s/transform (s/walker (every-pred vector? (fn-> count (= 1)) )) first data)
      {:data {:a [1 2 3] :b {:foo :bar}}})))

👍 8
richiardiandrea05:02:49

thanks a lot for answering!

steveb8n22:02:25

@akond thanks, I learned from that example too. a couple of questions: 1/ which lib does fn-> come from? 2/ the docs for walker imply it stops navigation when the predicate is satisfied once but, when I add another match, it transforms that too. this is what I want but it seems to contradict the docstring. what am I missing?

akond06:02:18

docs might be not up to date