Skip to content

Commit

Permalink
Use 2-arity <= in min-max validation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Sep 6, 2024
1 parent bf6d832 commit c59480e
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 c59480e

Please sign in to comment.