From e694fe26e56b1e1d277bd9302f589b46fd3e61c4 Mon Sep 17 00:00:00 2001 From: Ambrose Bonnaire-Sergeant Date: Tue, 20 Aug 2024 17:30:35 -0500 Subject: [PATCH] Close #1093: fix cljs arithmetic warning --- CHANGELOG.md | 4 ++++ src/malli/core.cljc | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dd625427..4dffa7969 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ We use [Break Versioning][breakver]. The version numbers follow a `.` added to default registry, see [documentation](https://github.com/metosin/malli/blob/master/docs/function-schemas.md#flat-arrow-function-schemas). diff --git a/src/malli/core.cljc b/src/malli/core.cljc index f8818b8bb..976f70feb 100644 --- a/src/malli/core.cljc +++ b/src/malli/core.cljc @@ -1297,7 +1297,8 @@ :else (let [size (when (and bounded (not (-safely-countable? x))) bounded)] (loop [acc acc, i 0, [x & xs :as ne] (seq x)] - (if (and ne (or (not size) (< i size))) + (if (and ne (or (not size) (< i #?(:cljs ^number size + :default size)))) (cond-> (or (explainer x (conj in (fin i x)) acc) acc) xs (recur (inc i) xs)) acc))))))) (-parser [_] (->parser (if bounded -validator -parser) (if bounded identity parse)))