Skip to content

Commit c25238e

Browse files
authored
Merge pull request #1105 from alexander-yakushev/min-max
Use 2-arity <= in min-max validation
2 parents bf6d832 + c59480e commit c25238e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/malli/core.cljc

+3-2
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,9 @@
652652
(fn [{:keys [min max]}]
653653
(cond
654654
(not (or min max)) nil
655-
(and (and min max) f) (fn [x] (let [size (f x)] (<= min size max)))
656-
(and min max) (fn [x] (<= min x max))
655+
(and (and min max) f) (fn [x] (let [size (f x)]
656+
(and (<= min size) (<= size max))))
657+
(and min max) (fn [x] (and (<= min x) (<= x max)))
657658
(and min f) (fn [x] (<= min (f x)))
658659
min (fn [x] (<= min x))
659660
(and max f) (fn [x] (<= (f x) max))

0 commit comments

Comments
 (0)