Skip to content

Commit

Permalink
Merge pull request #1105 from alexander-yakushev/min-max
Browse files Browse the repository at this point in the history
Use 2-arity <= in min-max validation
  • Loading branch information
ikitommi authored Sep 7, 2024
2 parents bf6d832 + c59480e commit c25238e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/malli/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,9 @@
(fn [{:keys [min max]}]
(cond
(not (or min max)) nil
(and (and min max) f) (fn [x] (let [size (f x)] (<= min size max)))
(and min max) (fn [x] (<= min x max))
(and (and min max) f) (fn [x] (let [size (f x)]
(and (<= min size) (<= size max))))
(and min max) (fn [x] (and (<= min x) (<= x max)))
(and min f) (fn [x] (<= min (f x)))
min (fn [x] (<= min x))
(and max f) (fn [x] (<= (f x) max))
Expand Down

0 comments on commit c25238e

Please sign in to comment.