Skip to content

Commit

Permalink
Manually destructure simple-schema props
Browse files Browse the repository at this point in the history
  • Loading branch information
bsless committed Aug 21, 2021
1 parent 55337ba commit e89a95c
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 @@ -375,7 +375,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 e89a95c

Please sign in to comment.