malli

https://github.com/metosin/malli :malli:
ikitommi 2021-03-25T18:38:00.230600Z

first kinda BREAKING change in the public api. m/parse on :multi now returns the branch information. It’s a fix, but still:

(def Multi
  [:multi {:dispatch :type}
   [:user [:map [:size :int]]]
   [::m/default :any]])

(m/parse Multi {:type :user, :size 1})
; => [:user {:type :user, :size 1}]

(m/parse Multi {:type "sized", :size 1})
; => [:malli.core/default {:type "sized", :size 1}]

(->> {:type :user, :size 1}
     (m/parse Multi)
     (m/unparse Multi))
; => {:type :user, :size 1}

ikitommi 2021-03-25T22:21:47.232100Z

+5 loc later (including comments): :and merges on first child! comments welcome on the results - https://github.com/metosin/malli/pull/405

ikitommi 2021-03-26T08:11:36.232400Z

ping @raymcdermott

1
raymcdermott 2021-03-26T16:20:58.232600Z

I thought it read 5k loc ... so πŸ˜…

raymcdermott 2021-03-26T16:21:15.232800Z

I have added a quick comment. Thanks for the feature

Yevgeni Tsodikov 2021-03-29T07:14:49.243700Z

Awesome MR! Thanks πŸ™

ikitommi 2021-03-29T10:34:07.243900Z

merged in master