Closed frenchy64 closed 2 months ago
well, I can do those. merging. thanks!
(mu/find [:map [:x :int]] :x)
; => [:x nil :int]
Thanks! I was trying to reverse engineer this line, tbh I still don't understand it. https://github.com/metosin/malli/blob/48544d533bf700151c886c13064c29a916a69fa9/src/malli/core.cljc#L360
mu/find
wraps the search key into a vector of [::m/find key]
, m/-get-entries
unwraps it and returns the full entry instead of just the value behind the key. Entries are still always of size 3.
(m/-get-entries (m/schema [:map [:x :int]]) :x nil)
; => :int
(m/-get-entries (m/schema [:map [:x :int]]) [::m/find :x] nil)
; => [:x nil :int]
This is what I came up with to answer this slack question: https://clojurians.slack.com/archives/CLDK6MFMK/p1712696483105789