File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1467
1467
(-check-children! :re properties children 1 1 )
1468
1468
(let [children (vec children)
1469
1469
re (re-pattern child)
1470
+ matches? #(and #?(:clj (instance? CharSequence %), :cljs (string? %))
1471
+ (re-find re %))
1470
1472
form (delay (if class? re (-simple-form parent properties children identity options)))
1471
1473
cache (-create-cache options)]
1472
1474
^{:type ::schema }
1475
1477
(-to-ast [this _] (-to-value-ast this))
1476
1478
Schema
1477
1479
(-validator [_]
1478
- (-safe-pred #( re-find re %) ))
1480
+ (-safe-pred matches? ))
1479
1481
(-explainer [this path]
1480
1482
(fn explain [x in acc]
1481
1483
(try
1482
- (if-not (re-find re x)
1484
+ (if-not (matches? x)
1483
1485
(conj acc (miu/-error path in this x))
1484
1486
acc)
1485
1487
(catch #?(:clj Exception, :cljs js/Error) e
You can’t perform that action at this time.
0 commit comments