[Question] dealing with parent children relationship
See original GitHub issue👋this library has been awesome for validating properties both static and dynamic which is great so thanks!
my question has there been any thoughts when for example you need to find duplicates
from the docs:
const input = {
id: 4,
users: {
one: {firstName: 'foobar', lastName: 'action'},
two: {firstName: 'foo', lastName: 'bar'},
three: {firstName: 'foobar', lastName: 'Action'},
}
}
const validationRules = {
id: [[ notEmpty, notEmptyMsg('id') ]],
users: map(always(userSpec)),
}
we can easily validate the children individual properties such as firstName
, lastName
but in order to find the duplicates between each users.one.firstName
, users.two.firstName
, etc child we need the actual users
object to compare each child
the only thing i can think of is maybe updating the validationRules
for users
to pre-process the input and then pass the function to merge with the existing userSpec
dont know if anyone else had a similar experience so i thought i would ask
cheers
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
10 Questions to Ask Your Kids About Their Relationship With ...
1. What is causing you the most stress with your parents? · 2. Do you have a regular time that you and your...
Read more >Relationship Building Questions To Ask Kids (With Printable!)
These are excellent questions to ask kids to help them open up, learn more about each other, and really build the parent child...
Read more >30 Questions To Ask Your Parents for a Better Relationship
Psychologists say questions to ask your parents to get to know them as people (rather than as just parents) can help strengthen your...
Read more >Parent-Child Relations - Science topic - ResearchGate
Parent-Child Relations are the interactions between parent and child. What is this study about? The purpose of this study is to understand possible...
Read more >Parent-Child Relationship Survey (PCRS)
Parent-Child Relationship Survey (PCRS) · 1. How much time do you feel you spend with your mother/father? (1 = almost none‚ 7 =...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@busypeoples cool sounds good, let me know what you come up with 😃
Hi! Thanks for the feedback! Will look into this, either today or tomorrow.