From c59480ef6c1f86115afc8d639c44909c3ec19e4b Mon Sep 17 00:00:00 2001 From: Oleksandr Yakushev Date: Fri, 6 Sep 2024 14:39:47 +0300 Subject: [PATCH] Use 2-arity <= in min-max validation --- src/malli/core.cljc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/malli/core.cljc b/src/malli/core.cljc index 05f2fc63c..e040a97b5 100644 --- a/src/malli/core.cljc +++ b/src/malli/core.cljc @@ -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))