-
Notifications
You must be signed in to change notification settings - Fork 336
feat(validators): Add validator for each object in an array #124
base: master
Are you sure you want to change the base?
Conversation
@ansman If |
Added a new validator, `each`, which applies a validation function provided in the options to each of the objects in the array being validated. Closes ansman#1
@ansman This seems like a valuable addition. What do you think? |
Hmm, I'd rather see that you specify a constraint for each element |
I think that's feasible, and I agree that it makes the constraint syntax less complex. However, the array case is slightly different from the object case: in an object, we know what the keys are that we want to validate, and we can define constraints for these keys one time (in a schema definition, for example). For an array, we would need to programmatically add constraints to the array of data we receive before performing validation. Like I said, it's feasible, but it's a different pattern, and the Thanks! |
Any updates to this PR? We'll we see this feature added soon? We could totally use this feature in our project. Thanks :) |
Seems good 👍 Any progress or ETA on this? |
Ping. This looks awesome! |
is this or #184 preferred? would love to have this feature! |
What's going on with this? |
Hello folks, any update on this nice feature? |
@ansman - are you going to accept this? if so I'll resolve the conflicts |
Any update on this? Cant wait to get this one! |
It looks like @ansman is no longer monitoring or maintaining this repository. I'm not sure if he wants to add some maintainers to this project or if someone should fork and continue development from there |
+1 to fork. We actually already forked this for this feature. An official
fork would be amazing.
…On Fri, Jul 6, 2018 at 11:13 AM John Bufe ***@***.***> wrote:
It looks like @ansman <https://github.com/ansman> is no longer monitoring
or maintaining this repository. I'm not sure if he wants to add some
maintainers to this project or if someone should fork and continue
development from there
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABNWSCHFI6SNe_n9HGafv2g6W5miRIAks5uD4zGgaJpZM4IPl2h>
.
|
@ansman If you no longer desire to maintain this project I am willing to take it over. Whether by forking or by via contributing to this repo. There is a surprising lack of pure-javascript validation libraries that can be easily used with React/Angular or other front-end libraries. @nebulousdog I would argue that this implementation is preferred over #184 because it returns an array with the same number of elements as the original data. This mirrors the way the rest of the library works much better and makes it easier to work with by keeping the same format between the original data and the error messages. Additionally, this PR has unit testing while the other does not. |
sounds good @vpillinger 👍 |
@vpillinger - if you end up forking, let me know and I can fix the merge conflicts and put this PR up against your repo |
feffe94
to
40e06a1
Compare
Hello, this PR is very important for the validator. Do we have any news about that? Won't you join the master branch? |
Added a new validator,
each
, which applies a validation functionprovided in the options to each of the objects in the array being
validated.
Closes #1