Skip to content

Commit

Permalink
Close #1093: fix cljs arithmetic warning
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchy64 committed Aug 20, 2024
1 parent 3924490 commit e694fe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ We use [Break Versioning][breakver]. The version numbers follow a `<major>.<mino

Malli is in well matured [alpha](README.md#alpha).

## Next

* Fix ClojureScript [arithmetic warning](https://github.com/metosin/malli/issues/1093)

## 0.16.3 (2024-08-05)

* `:->` added to default registry, see [documentation](https://github.com/metosin/malli/blob/master/docs/function-schemas.md#flat-arrow-function-schemas).
Expand Down
3 changes: 2 additions & 1 deletion src/malli/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit e694fe2

Please sign in to comment.