Fork me on GitHub
#malli
<
2022-02-17
>
DrLjótsson10:02:38

Is there a way to specify that a set needs to have at least one element? [:+ ...] only seems to work for sequences

DrLjótsson10:02:09

This is what I have come up with

[:and
 [:set :int]
 [:fn (fn [x] (not (empty? x)))]]

ikitommi11:02:19

maybe [:set {:min 1} :int]?

🙏 1
DrLjótsson11:02:49

That’s it, works!