Skip to content

Commit

Permalink
Merge pull request #520 from bsless/less-destructuring-simple-schema
Browse files Browse the repository at this point in the history
Manually destructure simple-schema props
  • Loading branch information
ikitommi authored Aug 23, 2021
2 parents 543c0a9 + e89a95c commit b154b39
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/malli/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@
(-into-schema [parent properties children options]
(if (fn? ?props)
(-into-schema (-simple-schema (?props properties children)) properties children options)
(let [{:keys [type pred property-pred min max], :or {min 0, max 0}} ?props]
(let [type (if ?props (?props :type))
pred (if ?props (?props :pred))
property-pred (if ?props (?props :property-pred))
min (if ?props (?props :min 0) 0)
max (if ?props (?props :max 0) 0)]
(reset! props* ?props)
(-check-children! type properties children {:min min, :max max})
(let [pvalidator (if property-pred (property-pred properties))
Expand Down

0 comments on commit b154b39

Please sign in to comment.