Skip to content

Commit

Permalink
Explicitly check for CharSequence in -re-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Sep 6, 2024
1 parent bf6d832 commit f722146
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/malli/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -1474,11 +1474,11 @@
(-to-ast [this _] (-to-value-ast this))
Schema
(-validator [_]
(-safe-pred #(re-find re %)))
(-safe-pred #(and (instance? CharSequence %) (re-find re %))))
(-explainer [this path]
(fn explain [x in acc]
(try
(if-not (re-find re x)
(if-not (and (instance? CharSequence x) (re-find re x))
(conj acc (miu/-error path in this x))
acc)
(catch #?(:clj Exception, :cljs js/Error) e
Expand Down

0 comments on commit f722146

Please sign in to comment.