Fork me on GitHub
#specter
<
2021-12-22
>
Wilson Velez13:12:51

Hi, I’m starting with specter and I have a question, I have this map {:a {:f-c "a" :p 3.3 :l 1} :b {:f-c "b" :p 6.7 :l 2}} that I want to transform it in [{:c "a" :pct 3.3} {:c "b" :pct 6.7}]

(def ui {:alloc {:a {:f-c "a" :p 3.3 :l 1} :b {:f-c "b" :p 6.7 :l 2}}})
(s/transform :alloc #(into [] %) ui) => {:alloc [[:a {:f-c "a", :p 3.3, :l 1}] [:b {:f-c "b", :p 6.7, :l 2}]]}
I haven’t been able to get the values of the internal maps in order to use their values and create a new structure what am I missing here?