Closed edgibbs closed 9 years ago
Any reason this validator applies to strings only?
I didn't have any use cases for testing the length of anything other than strings.
Fair enough. The implementation could easily be updated to work with any sequences however. That would make it more reusable - if you need it to be a string you could combine both v/string (merged recently) and your v/max-length.
Additionally, I'd rename max-length to count.
What do you think? If you update the PR, I'm happy to merge it. You might need to pull as other PR's have been merged since you first submitted this one.
Thanks
Sounds good, I'll take a look at it tomorrow.
Awesome. Thanks. On 20/01/2015 4:15 pm, "Ed Gibbs" notifications@github.com wrote:
Sounds good, I'll take a look at it tomorrow.
— Reply to this email directly or view it on GitHub https://github.com/leonardoborges/bouncer/pull/29#issuecomment-70605720.
I was wondering, if it wasn't to much trouble, could you create a min-length validator as well? If you don't have the time I could probably do it :)
OK, I'll add the min as well, but any preference on the names:
My preference is min-length and max-length
My preference is max-count
and min-count
.
My reasoning for this is that Clojure already has a count
function which works on sequences, therefore they seem more intuitive.
I don't have a strong preference, and leonardoborges makes a fair point.
Changes look good to me :+1:
Just adding a maximum length validation for strings.